mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Refactoring: do not hardcode "automodule" directive name when looking how to parse auto directive content.
This commit is contained in:
parent
38d9604985
commit
9d4f8c4a16
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user