Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #8936: LaTeX: A custom LaTeX builder fails with unknown node error #8958

Merged
merged 2 commits into from
Mar 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Features added
Bugs fixed
----------

* #8936: LaTeX: A custom LaTeX builder fails with unknown node error
* #8952: Exceptions raised in a Directive cause parallel builds to hang

Testing
Expand Down
18 changes: 9 additions & 9 deletions sphinx/builders/latex/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SubstitutionDefinitionsRemover(SphinxPostTransform):

# should be invoked after Substitutions process
default_priority = Substitutions.default_priority + 1
builders = ('latex',)
formats = ('latex',)

def run(self, **kwargs: Any) -> None:
for node in self.document.traverse(nodes.substitution_definition):
Expand All @@ -57,7 +57,7 @@ class ShowUrlsTransform(SphinxPostTransform):
.. note:: This transform is used for integrated doctree
"""
default_priority = 400
builders = ('latex',)
formats = ('latex',)

# references are expanded to footnotes (or not)
expanded = False
Expand Down Expand Up @@ -345,7 +345,7 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
"""

default_priority = 600
builders = ('latex',)
formats = ('latex',)

def run(self, **kwargs: Any) -> None:
footnotes = list(self.document.traverse(nodes.footnote))
Expand Down Expand Up @@ -497,7 +497,7 @@ class BibliographyTransform(SphinxPostTransform):
...
"""
default_priority = 750
builders = ('latex',)
formats = ('latex',)

def run(self, **kwargs: Any) -> None:
citations = thebibliography()
Expand All @@ -516,7 +516,7 @@ class CitationReferenceTransform(SphinxPostTransform):
pending_xref nodes to citation_reference.
"""
default_priority = 5 # before ReferencesResolver
builders = ('latex',)
formats = ('latex',)

def run(self, **kwargs: Any) -> None:
domain = cast(CitationDomain, self.env.get_domain('citation'))
Expand All @@ -536,7 +536,7 @@ class MathReferenceTransform(SphinxPostTransform):
nodes to math_reference.
"""
default_priority = 5 # before ReferencesResolver
builders = ('latex',)
formats = ('latex',)

def run(self, **kwargs: Any) -> None:
equations = self.env.get_domain('math').data['objects']
Expand All @@ -551,7 +551,7 @@ def run(self, **kwargs: Any) -> None:
class LiteralBlockTransform(SphinxPostTransform):
"""Replace container nodes for literal_block by captioned_literal_block."""
default_priority = 400
builders = ('latex',)
formats = ('latex',)

def run(self, **kwargs: Any) -> None:
matcher = NodeMatcher(nodes.container, literal_block=True)
Expand All @@ -563,7 +563,7 @@ def run(self, **kwargs: Any) -> None:
class DocumentTargetTransform(SphinxPostTransform):
"""Add :doc label to the first section of each document."""
default_priority = 400
builders = ('latex',)
formats = ('latex',)

def run(self, **kwargs: Any) -> None:
for node in self.document.traverse(addnodes.start_of_file):
Expand Down Expand Up @@ -599,7 +599,7 @@ class IndexInSectionTitleTransform(SphinxPostTransform):
...
"""
default_priority = 400
builders = ('latex',)
formats = ('latex',)

def run(self, **kwargs: Any) -> None:
for node in self.document.traverse(nodes.title):
Expand Down