diff --git a/doc/requirements.txt b/doc/requirements.txt index 012efb226..bfe78dea5 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -4,3 +4,4 @@ sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD openstackdocstheme>=1.18.1 # Apache-2.0 reno>=2.5.0 # Apache-2.0 +sphinxcontrib-apidoc>=0.2.0 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index c252baab1..42d2176e5 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -17,10 +17,19 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ - 'sphinx.ext.autodoc', 'openstackdocstheme', + 'sphinx.ext.autodoc', + 'sphinxcontrib.apidoc', ] +# sphinxcontrib.apidoc options +apidoc_module_dir = '../../novaclient' +apidoc_output_dir = 'reference/api' +apidoc_excluded_paths = [ + 'tests/*', + 'v2/contrib/*'] +apidoc_separate_modules = True + # The content that will be inserted into the main body of an autoclass # directive. autoclass_content = 'both' diff --git a/doc/source/reference/api/index.rst b/doc/source/reference/api/index.rst index e332c3647..e195abf2e 100644 --- a/doc/source/reference/api/index.rst +++ b/doc/source/reference/api/index.rst @@ -104,6 +104,6 @@ Reference For more information, see the reference: .. toctree:: - :maxdepth: 2 + :maxdepth: 6 - autoindex + modules diff --git a/setup.cfg b/setup.cfg index 7b3f4a201..19e05c17b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,21 +29,9 @@ packages = console_scripts = nova = novaclient.shell:main -[build_sphinx] -builders = html,man -all-files = 1 -warning-is-error = 1 -source-dir = doc/source -build-dir = doc/build - [upload_sphinx] upload-dir = doc/build/html -[pbr] -autodoc_index_modules = True -autodoc_exclude_modules = novaclient.tests.* novaclient.v2.contrib.* -api_doc_dir = reference/api - [compile_catalog] domain = novaclient directory = novaclient/locale diff --git a/tox.ini b/tox.ini index b3666b182..a6eaefbde 100644 --- a/tox.ini +++ b/tox.ini @@ -46,7 +46,7 @@ deps = -r{toxinidir}/doc/requirements.txt commands = rm -rf doc/build - sphinx-build -b html doc/source doc/build/html + sphinx-build -W -b html doc/source doc/build/html [testenv:releasenotes] basepython = python3