docs: Use sphinx-apidoc library for autodoc generation
This package is used for automatic generation of autodoc
documentation which offers the following advantages:
* the Patrole framework for all modules is always built
and kept up to date
* it is isolated in its own page layout
* it can still be linked to by other documentation pages
easily
Change-Id: I101557efe47293f88ee65b99275fdc8424c02e35
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 88c1bea..45d8021 100755
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -15,7 +15,13 @@
import os
import sys
-sys.path.insert(0, os.path.abspath('../..'))
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+sys.path.insert(0, os.path.abspath('../../'))
+sys.path.insert(0, os.path.abspath('../'))
+sys.path.insert(0, os.path.abspath('./'))
+
# -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
@@ -26,8 +32,23 @@
'sphinx.ext.viewcode',
'openstackdocstheme',
'oslo_config.sphinxconfiggen',
+ 'sphinxcontrib.apidoc',
]
+# sphinxcontrib.apidoc options
+apidoc_module_dir = '../../patrole_tempest_plugin'
+apidoc_output_dir = 'framework/code'
+apidoc_excluded_paths = [
+ 'hacking',
+ 'hacking/*',
+ 'tests',
+ 'tests/*',
+ 'config.py',
+ 'plugin.py',
+ 'version.py'
+]
+apidoc_separate_modules = True
+
config_generator_config_file = '../../etc/config-generator.patrole.conf'
sample_config_basename = '_static/patrole'