mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #7219: py:module directive generates incorrect index entry
This commit is contained in:
@@ -926,8 +926,8 @@ class PyModule(SphinxDirective):
|
||||
# the platform and synopsis aren't printed; in fact, they are only
|
||||
# used in the modindex currently
|
||||
ret.append(target)
|
||||
indextext = _('%s (module)') % modname
|
||||
inode = addnodes.index(entries=[('single', indextext, node_id, '', None)])
|
||||
indextext = '%s; %s' % (pairindextypes['module'], modname)
|
||||
inode = addnodes.index(entries=[('pair', indextext, node_id, '', None)])
|
||||
ret.append(inode)
|
||||
return ret
|
||||
|
||||
|
||||
@@ -481,7 +481,7 @@ def test_pyfunction(app):
|
||||
assert_node(doctree[0], addnodes.index,
|
||||
entries=[('pair', 'built-in function; func1()', 'func1', '', None)])
|
||||
assert_node(doctree[3], addnodes.index,
|
||||
entries=[('single', 'example (module)', 'module-example', '', None)])
|
||||
entries=[('pair', 'module; example', 'module-example', '', None)])
|
||||
assert_node(doctree[4], addnodes.index,
|
||||
entries=[('single', 'func2() (in module example)', 'example.func2', '', None)])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user