Skip to content

Commit

Permalink
Use sphinxcontrib-apidoc
Browse files Browse the repository at this point in the history
To build API documentation as part of sphinx-build, rather than
requiring a prior separate invocation of sphinx-apidoc (which requires
additional knowledge/configuration, e.g. on Read the Docs).  See:
readthedocs/readthedocs.org#1139
sphinx-doc/sphinx#4101

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
  • Loading branch information
kevinoid committed Jun 18, 2022
1 parent 7ffeb9e commit 1007ae3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinxarg.ext',
'sphinxcontrib.apidoc',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -213,6 +214,10 @@

# -- Extension configuration -------------------------------------------------

# -- Options for apidoc extension --------------------------------------------

apidoc_module_dir = '../src/packagename'

# -- Options for intersphinx extension ---------------------------------------

# Map external identifiers to (base URI, inventory) pair. None is objects.inv
Expand Down
1 change: 1 addition & 0 deletions requirements/docs.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Abstract top-level documentation generator dependencies
Sphinx
sphinx-argparse
sphinxcontrib-apidoc
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ commands = python -bb -m pytest --cov={envsitepackagesdir}{/}packagename {posarg
[testenv:docs]
commands_pre = pip install -rrequirements/docs.in
commands =
sphinx-apidoc -o docs/api src/packagename
sphinx-build -nW -j auto docs docs/_build

[testenv:lint]
Expand Down

0 comments on commit 1007ae3

Please sign in to comment.