summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDavanum Srinivas <dims@linux.vnet.ibm.com>2014-09-03 20:58:59 -0400
committerDavanum Srinivas <dims@linux.vnet.ibm.com>2014-09-04 22:48:57 -0400
commit17b33061b22b6558a2aa666fdcae6534bc2b1c79 (patch)
tree188b2fd3438026ca55ce138e172daed6a0554dbb /doc
parent70dcb607969557f0c051faf4f7a4a6328c2c2529 (diff)
downloadoslo-concurrency-17b33061b22b6558a2aa666fdcae6534bc2b1c79.tar.gz
Add code/api documentation
Once we use the pbr based build to generate files, we prune the indexes to remove references to code we would like to hide like the common modules and private modules in conf.py. We reuse the same excluded_patterns variable that is already used in Sphinx and filter these modules from autoindex.rst Change-Id: I4baea1efa227ef14bc6706d59ff3dcad93c2eacc Closes-Bug: #1364140
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/source/conf.py19
-rw-r--r--doc/source/index.rst8
2 files changed, 27 insertions, 0 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index ad9161d..4f69dc1 100755
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -14,6 +14,8 @@
import os
import sys
+import fileinput
+import fnmatch
sys.path.insert(0, os.path.abspath('../..'))
# -- General configuration ----------------------------------------------------
@@ -30,6 +32,23 @@ extensions = [
# text edit cycles.
# execute "export SPHINX_DEBUG=1" in your terminal to disable
+# A list of glob-style patterns that should be excluded when looking for source
+# files.
+exclude_patterns = [
+ 'api/tests.*', # avoid of docs generation from tests
+ 'api/oslo.concurrency.openstack.common.*', # skip common modules
+ 'api/oslo.concurrency._*', # skip private modules
+]
+
+# Prune the excluded patterns from the autoindex
+for line in fileinput.input('api/autoindex.rst', inplace=True):
+ found = False
+ for pattern in exclude_patterns:
+ if fnmatch.fnmatch(line, '*' + pattern[4:]):
+ found = True
+ if not found:
+ print line,
+
# The suffix of source filenames.
source_suffix = '.rst'
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 8ed8add..dc4f6f2 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -16,6 +16,14 @@ Contents:
usage
contributing
+Code Documentation
+==================
+
+.. toctree::
+ :maxdepth: 1
+
+ api/autoindex
+
Indices and tables
==================