diff --git a/doc/requirements.txt b/doc/requirements.txt index f2ab00e7..73a167f3 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -4,3 +4,4 @@ sphinx>=2.0.0,!=2.1.0 # BSD reno>=3.1.0 # Apache-2.0 openstackdocstheme>=2.2.1 # Apache-2.0 +sphinxcontrib-apidoc>=0.2.0 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index 351cb23e..2f483c05 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -6,7 +6,11 @@ # 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', 'sphinx.ext.viewcode', 'openstackdocstheme'] +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.viewcode', + 'sphinxcontrib.apidoc', + 'openstackdocstheme'] # openstackdocstheme options openstackdocs_repo_name = 'openstack/python-designateclient' @@ -14,6 +18,15 @@ openstackdocs_bug_project = 'python-designateclient' openstackdocs_bug_tag = '' html_theme = 'openstackdocs' +apidoc_module_dir = '../../designateclient' +apidoc_output_dir = 'reference/api' +apidoc_excluded_paths = [ 'tests/*', 'functionaltests/*' ] +apidoc_separate_modules = True + +autodoc_exclude_modules = [ + 'designateclient.tests.*', + 'designateclient.functionaltests.*'] + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index 331be172..a2def4e1 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -3,5 +3,6 @@ ================================== .. toctree:: + :maxdepth: 4 - api/autoindex + api/modules diff --git a/setup.cfg b/setup.cfg index 67d622ee..5a07d180 100644 --- a/setup.cfg +++ b/setup.cfg @@ -117,10 +117,3 @@ input_file = designateclient/locale/designateclient.pot keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg output_file = designateclient/locale/designateclient.pot - -[pbr] -autodoc_index_modules = True -api_doc_dir = reference/api -autodoc_exclude_modules = - designateclient.tests.* - designateclient.functionaltests.* diff --git a/tox.ini b/tox.ini index f7bb18f1..eda694dd 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,7 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/doc/requirements.txt -commands = sphinx-build -b html doc/source doc/build/html +commands = sphinx-build -W -b html doc/source doc/build/html [testenv:flake8] commands = flake8