summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-01-07 14:07:42 +0100
committerGeorg Brandl <georg@python.org>2011-01-07 14:07:42 +0100
commit9d4f8c4a161cc85935ddcf11aa99da5b98201251 (patch)
tree119f943d0d5d06c292528183b10004026dbbd945 /sphinx/ext/autodoc.py
parent38d96049858e46e074e514e45736a85c63b17b01 (diff)
downloadsphinx-git-9d4f8c4a161cc85935ddcf11aa99da5b98201251.tar.gz
Refactoring: do not hardcode "automodule" directive name when looking how to parse auto directive content.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index b135d3578..d184342ef 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -223,6 +223,8 @@ class Documenter(object):
priority = 0
#: order if autodoc_member_order is set to 'groupwise'
member_order = 0
+ #: true if the generated content may contain titles
+ titles_allowed = False
option_spec = {'noindex': bool_option}
@@ -717,6 +719,7 @@ class ModuleDocumenter(Documenter):
"""
objtype = 'module'
content_indent = u''
+ titles_allowed = True
option_spec = {
'members': members_option, 'undoc-members': bool_option,
@@ -1184,7 +1187,7 @@ class AutoDirective(Directive):
self.state.memo.reporter = AutodocReporter(self.result,
self.state.memo.reporter)
- if self.name == 'automodule':
+ if documenter.titles_allowed:
node = nodes.section()
# necessary so that the child nodes get the right source/line set
node.document = self.state.document