summaryrefslogtreecommitdiffstats
path: root/doc/conf.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-06 13:55:50 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-06 13:55:50 -0400
commit7d277c0d5fef3d0cdb9ca9b97cb2bca09f0f46c5 (patch)
tree16cf42edd6ffcfd703ef3621369b6605a6998031 /doc/conf.py
parentd3aa773f9f42045a0922d6c194e01d029ee53a40 (diff)
downloadbcfg2-7d277c0d5fef3d0cdb9ca9b97cb2bca09f0f46c5.tar.gz
bcfg2-7d277c0d5fef3d0cdb9ca9b97cb2bca09f0f46c5.tar.bz2
bcfg2-7d277c0d5fef3d0cdb9ca9b97cb2bca09f0f46c5.zip
Documented all plugin helper objects
Diffstat (limited to 'doc/conf.py')
-rw-r--r--doc/conf.py33
1 files changed, 32 insertions, 1 deletions
diff --git a/doc/conf.py b/doc/conf.py
index 4497b78d7..cc471e776 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -12,6 +12,7 @@
# serve to show the default.
import os
+import re
import sys
import time
@@ -24,7 +25,8 @@ import time
# 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.doctest']
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
+ 'sphinx.ext.intersphinx']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -212,4 +214,33 @@ else:
# If false, no module index is generated.
latex_use_modindex = False
+# autodoc settings
autodoc_default_flags = ['members', 'show-inheritance']
+autoclass_content = "both"
+
+private_re = re.compile(r'^\s*\.\.\s*private-include\s*$')
+
+def skip_member_from_docstring(app, what, name, obj, skip, options):
+ """ since sphinx 1.0 autodoc doesn't support the :private-members:
+ directive, this function allows you to specify
+ ``.. private-include`` in the docstring of a private method, etc.,
+ to ensure that it's included. This only works on things with
+ docstrings """
+ if (not skip or
+ not hasattr(obj, '__doc__') or not obj.__doc__):
+ return skip
+
+ for line in obj.__doc__.splitlines():
+ if private_re.match(line):
+ return False
+
+ return skip
+
+def setup(app):
+ app.connect('autodoc-skip-member', skip_member_from_docstring)
+
+# intersphinx settings
+intersphinx_mapping = dict(
+ py=('http://docs.python.org/%s' % '.'.join(str(v)
+ for v in sys.version_info[0:2]),
+ None))