mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
LaTeX: Restructure the index nodes inside title nodes only on LaTeX builds
refs: #8865
This commit is contained in:
parent
674831cf10
commit
9411051131
2
CHANGES
2
CHANGES
@ -142,6 +142,8 @@ Bugs fixed
|
|||||||
the :ref:`'sphinxsetup' <latexsphinxsetup>` key of ``latex_elements``)
|
the :ref:`'sphinxsetup' <latexsphinxsetup>` key of ``latex_elements``)
|
||||||
* #8183: LaTeX: Remove substitution_reference nodes from doctree only on LaTeX
|
* #8183: LaTeX: Remove substitution_reference nodes from doctree only on LaTeX
|
||||||
builds
|
builds
|
||||||
|
* #8865: LaTeX: Restructure the index nodes inside title nodes only on LaTeX
|
||||||
|
builds
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -574,7 +574,7 @@ class DocumentTargetTransform(SphinxPostTransform):
|
|||||||
section['ids'].append(':doc') # special label for :doc:
|
section['ids'].append(':doc') # special label for :doc:
|
||||||
|
|
||||||
|
|
||||||
class IndexInSectionTitleTransform(SphinxTransform):
|
class IndexInSectionTitleTransform(SphinxPostTransform):
|
||||||
"""Move index nodes in section title to outside of the title.
|
"""Move index nodes in section title to outside of the title.
|
||||||
|
|
||||||
LaTeX index macro is not compatible with some handling of section titles
|
LaTeX index macro is not compatible with some handling of section titles
|
||||||
@ -601,8 +601,9 @@ class IndexInSectionTitleTransform(SphinxTransform):
|
|||||||
...
|
...
|
||||||
"""
|
"""
|
||||||
default_priority = 400
|
default_priority = 400
|
||||||
|
builders = ('latex',)
|
||||||
|
|
||||||
def apply(self, **kwargs: Any) -> None:
|
def run(self, **kwargs: Any) -> None:
|
||||||
for node in self.document.traverse(nodes.title):
|
for node in self.document.traverse(nodes.title):
|
||||||
if isinstance(node.parent, nodes.section):
|
if isinstance(node.parent, nodes.section):
|
||||||
for i, index in enumerate(node.traverse(addnodes.index)):
|
for i, index in enumerate(node.traverse(addnodes.index)):
|
||||||
|
Loading…
Reference in New Issue
Block a user