mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #669: Respect the `noindex` flag option in py:module directives.
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,6 +1,8 @@
|
|||||||
Release 1.0.8 (in development)
|
Release 1.0.8 (in development)
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
|
* #669: Respect the ``noindex`` flag option in py:module directives.
|
||||||
|
|
||||||
* #675: Fix IndexErrors when including nonexisting lines with
|
* #675: Fix IndexErrors when including nonexisting lines with
|
||||||
:rst:dir:`literalinclude`.
|
:rst:dir:`literalinclude`.
|
||||||
|
|
||||||
|
|||||||
@@ -381,15 +381,18 @@ class PyModule(Directive):
|
|||||||
modname = self.arguments[0].strip()
|
modname = self.arguments[0].strip()
|
||||||
noindex = 'noindex' in self.options
|
noindex = 'noindex' in self.options
|
||||||
env.temp_data['py:module'] = modname
|
env.temp_data['py:module'] = modname
|
||||||
|
ret = []
|
||||||
|
if not noindex:
|
||||||
env.domaindata['py']['modules'][modname] = \
|
env.domaindata['py']['modules'][modname] = \
|
||||||
(env.docname, self.options.get('synopsis', ''),
|
(env.docname, self.options.get('synopsis', ''),
|
||||||
self.options.get('platform', ''), 'deprecated' in self.options)
|
self.options.get('platform', ''), 'deprecated' in self.options)
|
||||||
# make a duplicate entry in 'objects' to facilitate searching for the
|
# make a duplicate entry in 'objects' to facilitate searching for
|
||||||
# module in PythonDomain.find_obj()
|
# the module in PythonDomain.find_obj()
|
||||||
env.domaindata['py']['objects'][modname] = (env.docname, 'module')
|
env.domaindata['py']['objects'][modname] = (env.docname, 'module')
|
||||||
targetnode = nodes.target('', '', ids=['module-' + modname], ismod=True)
|
targetnode = nodes.target('', '', ids=['module-' + modname],
|
||||||
|
ismod=True)
|
||||||
self.state.document.note_explicit_target(targetnode)
|
self.state.document.note_explicit_target(targetnode)
|
||||||
ret = [targetnode]
|
ret.append(targetnode)
|
||||||
# XXX this behavior of the module directive is a mess...
|
# XXX this behavior of the module directive is a mess...
|
||||||
if 'platform' in self.options:
|
if 'platform' in self.options:
|
||||||
platform = self.options['platform']
|
platform = self.options['platform']
|
||||||
|
|||||||
Reference in New Issue
Block a user