Refactoring: do not hardcode "automodule" directive name when looking how to parse auto directive content.

This commit is contained in:
Georg Brandl 2011-01-07 14:07:42 +01:00
parent 38d9604985
commit 9d4f8c4a16

View File

@ -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