A Sphinx extension for running 'sphinx-apidoc' on each build
Project description
A Sphinx extension for running sphinx-apidoc on each build.
Overview
sphinx-apidoc is a tool for automatic generation of Sphinx sources that, using the autodoc extension, document a whole package in the style of other automatic API documentation tools. sphinx-apidoc does not actually build documentation - rather it simply generates it. As a result, it must be run before sphinx-build. This generally results in tox.ini files like the following:
[testenv:docs]
commands =
sphinx-apidoc -o doc/api my_code my_code/tests
sphinx-build -W -b html doc doc/_build/html
This extension eliminates the need to keep that configuration outside Sphinx. Instead, this functionality can be enabled and configured from your documentation’s conf.py file, like so:
extensions = [
'sphinxcontrib.apidoc',
# ...
]
apidoc_module_dir = '../my_code'
apidoc_output_dir = 'reference'
apidoc_excluded_paths = ['tests']
Configuration
The apidoc extension uses the following configuration values:
- apidoc_module_dir
The path to the module to document. This must be a path to a Python package. This path can be a path relative to the documentation source directory or an absolute path.
Required
- apidoc_output_dir
The output directory. If it does not exist, it is created. This path is relative to the documentation source directory.
Optional, defaults to api.
- apidoc_excluded_paths
An optional list of modules to exclude. These should be paths relative to apidoc_module_dir. fnmatch-style wildcarding is supported.
Optional, defaults to [].
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sphinxcontrib-apidoc-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3433dcff45e7a6832a25ded3fe46b6a8bd99152840964756b167624d0d9cde05 |
|
MD5 | 87cb1ee1af2383ea455b4dc17e6c7ccc |
|
BLAKE2b-256 | 6c651a9ea0d57405f4d7b0449d75a21b8d35120e798bef701614b58e99b0d27d |
Hashes for sphinxcontrib_apidoc-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1d0d2d5305268ae236dd9609f56539c587044c8bcd88b5ee2e644c94cec3ac8 |
|
MD5 | 3fe4e7441e6278a137c1b336fbe07412 |
|
BLAKE2b-256 | 6c4f02d654a73b06a36e629bbd2c5211d35b00e5cd27b8fa3fc5f7420464d518 |