mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Support `:no-index-entry:
in
.. {js,py}:module::
` (#13272)
This commit is contained in:
@@ -326,6 +326,25 @@ def test_no_index_entry(app):
|
||||
)
|
||||
assert_node(doctree[2], addnodes.index, entries=[])
|
||||
|
||||
text = '.. js:class:: f\n.. js:class:: g\n :no-index-entry:\n'
|
||||
doctree = restructuredtext.parse(app, text)
|
||||
assert_node(doctree, (addnodes.index, desc, addnodes.index, desc))
|
||||
assert_node(
|
||||
doctree[0],
|
||||
addnodes.index,
|
||||
entries=[('single', 'f() (class)', 'f', '', None)],
|
||||
)
|
||||
assert_node(doctree[2], addnodes.index, entries=[])
|
||||
|
||||
text = '.. js:module:: f\n.. js:module:: g\n :no-index-entry:\n'
|
||||
doctree = restructuredtext.parse(app, text)
|
||||
assert_node(doctree, (addnodes.index, nodes.target, nodes.target))
|
||||
assert_node(
|
||||
doctree[0],
|
||||
addnodes.index,
|
||||
entries=[('single', 'f (module)', 'module-f', '', None)],
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='root')
|
||||
def test_module_content_line_number(app):
|
||||
|
@@ -836,6 +836,15 @@ def test_no_index_entry(app):
|
||||
)
|
||||
assert_node(doctree[2], addnodes.index, entries=[])
|
||||
|
||||
text = '.. py:module:: f\n.. py:module:: g\n :no-index-entry:\n'
|
||||
doctree = restructuredtext.parse(app, text)
|
||||
assert_node(doctree, (addnodes.index, nodes.target, nodes.target))
|
||||
assert_node(
|
||||
doctree[0],
|
||||
addnodes.index,
|
||||
entries=[('pair', 'module; f', 'module-f', '', None)],
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='domain-py-python_use_unqualified_type_names')
|
||||
def test_python_python_use_unqualified_type_names(app):
|
||||
|
Reference in New Issue
Block a user