diff options
author | Calum Lind <calumlind@gmail.com> | 2018-11-02 00:09:53 +0000 |
---|---|---|
committer | Calum Lind <calumlind@gmail.com> | 2018-11-02 00:21:50 +0000 |
commit | 98051bdea23eefbbb4a230d63230bd29675c2356 (patch) | |
tree | e49e54cc253542a0e535ef94588eaefe48086041 /docs/source/conf.py | |
parent | 20431cc7712e67b9249251dc47162333785d5e91 (diff) | |
download | deluge-98051bdea23eefbbb4a230d63230bd29675c2356.tar.gz deluge-98051bdea23eefbbb4a230d63230bd29675c2356.tar.bz2 deluge-98051bdea23eefbbb4a230d63230bd29675c2356.zip |
[Docs] Move apidoc command to Sphinx config
The apidoc modules were not being generated on ReadTheDocs because
there is no way to run sphinx-apidoc manually.
Moved the running of sphinx-apidoc into conf.py.
Added zope.interface minimum version to fix Readthedocs warning.
Diffstat (limited to 'docs/source/conf.py')
-rw-r--r-- | docs/source/conf.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py index 24bd4e368..e1a60a14a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,6 +18,7 @@ from datetime import date import pkg_resources from recommonmark.states import DummyStateMachine from recommonmark.transform import AutoStructify +from sphinx.ext import apidoc from sphinx.ext.autodoc import ClassDocumenter, bool_option try: @@ -297,7 +298,26 @@ def maybe_skip_member(app, what, name, obj, skip, options): return True +# Run the sphinx-apidoc to create package/modules rst files for autodoc. +def run_apidoc(__): + cur_dir = os.path.abspath(os.path.dirname(__file__)) + module_dir = os.path.join(cur_dir, '..', '..', 'deluge') + ignore_paths = [ + os.path.join(module_dir, 'plugins'), + os.path.join(module_dir, 'tests'), + ] + argv = [ + '--force', + '--no-toc', + '--output-dir', + os.path.join(cur_dir, 'modules'), + module_dir, + ] + ignore_paths + apidoc.main(argv) + + def setup(app): + app.connect('builder-inited', run_apidoc) app.connect('autodoc-skip-member', maybe_skip_member) app.add_config_value('recommonmark_config', {}, True) app.add_transform(AutoStructify) |