mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #8958 from tk0miya/8936_custom_latex_builder
Fix #8936: LaTeX: A custom LaTeX builder fails with unknown node error
This commit is contained in:
commit
cb14587af5
1
CHANGES
1
CHANGES
@ -16,6 +16,7 @@ Features added
|
|||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* #8936: LaTeX: A custom LaTeX builder fails with unknown node error
|
||||||
* #8952: Exceptions raised in a Directive cause parallel builds to hang
|
* #8952: Exceptions raised in a Directive cause parallel builds to hang
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
|
@ -42,7 +42,7 @@ class SubstitutionDefinitionsRemover(SphinxPostTransform):
|
|||||||
|
|
||||||
# should be invoked after Substitutions process
|
# should be invoked after Substitutions process
|
||||||
default_priority = Substitutions.default_priority + 1
|
default_priority = Substitutions.default_priority + 1
|
||||||
builders = ('latex',)
|
formats = ('latex',)
|
||||||
|
|
||||||
def run(self, **kwargs: Any) -> None:
|
def run(self, **kwargs: Any) -> None:
|
||||||
for node in self.document.traverse(nodes.substitution_definition):
|
for node in self.document.traverse(nodes.substitution_definition):
|
||||||
@ -57,7 +57,7 @@ class ShowUrlsTransform(SphinxPostTransform):
|
|||||||
.. note:: This transform is used for integrated doctree
|
.. note:: This transform is used for integrated doctree
|
||||||
"""
|
"""
|
||||||
default_priority = 400
|
default_priority = 400
|
||||||
builders = ('latex',)
|
formats = ('latex',)
|
||||||
|
|
||||||
# references are expanded to footnotes (or not)
|
# references are expanded to footnotes (or not)
|
||||||
expanded = False
|
expanded = False
|
||||||
@ -345,7 +345,7 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
default_priority = 600
|
default_priority = 600
|
||||||
builders = ('latex',)
|
formats = ('latex',)
|
||||||
|
|
||||||
def run(self, **kwargs: Any) -> None:
|
def run(self, **kwargs: Any) -> None:
|
||||||
footnotes = list(self.document.traverse(nodes.footnote))
|
footnotes = list(self.document.traverse(nodes.footnote))
|
||||||
@ -497,7 +497,7 @@ class BibliographyTransform(SphinxPostTransform):
|
|||||||
...
|
...
|
||||||
"""
|
"""
|
||||||
default_priority = 750
|
default_priority = 750
|
||||||
builders = ('latex',)
|
formats = ('latex',)
|
||||||
|
|
||||||
def run(self, **kwargs: Any) -> None:
|
def run(self, **kwargs: Any) -> None:
|
||||||
citations = thebibliography()
|
citations = thebibliography()
|
||||||
@ -516,7 +516,7 @@ class CitationReferenceTransform(SphinxPostTransform):
|
|||||||
pending_xref nodes to citation_reference.
|
pending_xref nodes to citation_reference.
|
||||||
"""
|
"""
|
||||||
default_priority = 5 # before ReferencesResolver
|
default_priority = 5 # before ReferencesResolver
|
||||||
builders = ('latex',)
|
formats = ('latex',)
|
||||||
|
|
||||||
def run(self, **kwargs: Any) -> None:
|
def run(self, **kwargs: Any) -> None:
|
||||||
domain = cast(CitationDomain, self.env.get_domain('citation'))
|
domain = cast(CitationDomain, self.env.get_domain('citation'))
|
||||||
@ -536,7 +536,7 @@ class MathReferenceTransform(SphinxPostTransform):
|
|||||||
nodes to math_reference.
|
nodes to math_reference.
|
||||||
"""
|
"""
|
||||||
default_priority = 5 # before ReferencesResolver
|
default_priority = 5 # before ReferencesResolver
|
||||||
builders = ('latex',)
|
formats = ('latex',)
|
||||||
|
|
||||||
def run(self, **kwargs: Any) -> None:
|
def run(self, **kwargs: Any) -> None:
|
||||||
equations = self.env.get_domain('math').data['objects']
|
equations = self.env.get_domain('math').data['objects']
|
||||||
@ -551,7 +551,7 @@ class MathReferenceTransform(SphinxPostTransform):
|
|||||||
class LiteralBlockTransform(SphinxPostTransform):
|
class LiteralBlockTransform(SphinxPostTransform):
|
||||||
"""Replace container nodes for literal_block by captioned_literal_block."""
|
"""Replace container nodes for literal_block by captioned_literal_block."""
|
||||||
default_priority = 400
|
default_priority = 400
|
||||||
builders = ('latex',)
|
formats = ('latex',)
|
||||||
|
|
||||||
def run(self, **kwargs: Any) -> None:
|
def run(self, **kwargs: Any) -> None:
|
||||||
matcher = NodeMatcher(nodes.container, literal_block=True)
|
matcher = NodeMatcher(nodes.container, literal_block=True)
|
||||||
@ -563,7 +563,7 @@ class LiteralBlockTransform(SphinxPostTransform):
|
|||||||
class DocumentTargetTransform(SphinxPostTransform):
|
class DocumentTargetTransform(SphinxPostTransform):
|
||||||
"""Add :doc label to the first section of each document."""
|
"""Add :doc label to the first section of each document."""
|
||||||
default_priority = 400
|
default_priority = 400
|
||||||
builders = ('latex',)
|
formats = ('latex',)
|
||||||
|
|
||||||
def run(self, **kwargs: Any) -> None:
|
def run(self, **kwargs: Any) -> None:
|
||||||
for node in self.document.traverse(addnodes.start_of_file):
|
for node in self.document.traverse(addnodes.start_of_file):
|
||||||
@ -599,7 +599,7 @@ class IndexInSectionTitleTransform(SphinxPostTransform):
|
|||||||
...
|
...
|
||||||
"""
|
"""
|
||||||
default_priority = 400
|
default_priority = 400
|
||||||
builders = ('latex',)
|
formats = ('latex',)
|
||||||
|
|
||||||
def run(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):
|
||||||
|
Loading…
Reference in New Issue
Block a user