mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #8866 from tk0miya/8865_IndexInSectionTitleTransform
LaTeX: Restructure the index nodes inside title nodes only on LaTeX builds
This commit is contained in:
commit
13d475aa73
2
CHANGES
2
CHANGES
@ -146,6 +146,8 @@ Bugs fixed
|
||||
the :ref:`'sphinxsetup' <latexsphinxsetup>` key of ``latex_elements``)
|
||||
* #8183: LaTeX: Remove substitution_reference nodes from doctree only on LaTeX
|
||||
builds
|
||||
* #8865: LaTeX: Restructure the index nodes inside title nodes only on LaTeX
|
||||
builds
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -572,7 +572,7 @@ class DocumentTargetTransform(SphinxPostTransform):
|
||||
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.
|
||||
|
||||
LaTeX index macro is not compatible with some handling of section titles
|
||||
@ -599,8 +599,9 @@ class IndexInSectionTitleTransform(SphinxTransform):
|
||||
...
|
||||
"""
|
||||
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):
|
||||
if isinstance(node.parent, nodes.section):
|
||||
for i, index in enumerate(node.traverse(addnodes.index)):
|
||||
|
Loading…
Reference in New Issue
Block a user