mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove substitution_definition nodes from doctree on reading phase (refs: #4827)
This commit is contained in:
parent
19585962a2
commit
af58d7faed
2
CHANGES
2
CHANGES
@ -17,6 +17,8 @@ Incompatible changes
|
||||
a ``conf.py`` file sphinx-build generates.
|
||||
* The ``gettext_compact`` attribute is removed from ``document.settings``
|
||||
object. Please use ``config.gettext_compact`` instead.
|
||||
* #4827: All ``substitution_definition`` nodes are removed from doctree on
|
||||
reading phase
|
||||
|
||||
Deprecated
|
||||
----------
|
||||
|
@ -25,7 +25,6 @@ from sphinx.environment.adapters.asset import ImageAdapter
|
||||
from sphinx.errors import SphinxError, ConfigError
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.transforms import SphinxTransformer
|
||||
from sphinx.transforms.references import SubstitutionDefinitionsRemover
|
||||
from sphinx.util import texescape, logging, status_iterator
|
||||
from sphinx.util.console import bold, darkgreen # type: ignore
|
||||
from sphinx.util.docutils import new_document
|
||||
@ -217,7 +216,6 @@ class LaTeXBuilder(Builder):
|
||||
# type: (nodes.document) -> None
|
||||
transformer = SphinxTransformer(doctree)
|
||||
transformer.set_environment(self.env)
|
||||
transformer.add_transforms([SubstitutionDefinitionsRemover])
|
||||
transformer.apply_transforms()
|
||||
|
||||
def finish(self):
|
||||
|
@ -31,6 +31,7 @@ from sphinx.transforms.compact_bullet_list import RefOnlyBulletListTransform
|
||||
from sphinx.transforms.i18n import (
|
||||
PreserveTranslatableMessages, Locale, RemoveTranslatableInline,
|
||||
)
|
||||
from sphinx.transforms.references import SubstitutionDefinitionsRemover
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.docutils import LoggingReporter
|
||||
|
||||
@ -93,7 +94,8 @@ class SphinxStandaloneReader(SphinxBaseReader):
|
||||
Locale, CitationReferences, DefaultSubstitutions, MoveModuleTargets,
|
||||
HandleCodeBlocks, AutoNumbering, AutoIndexUpgrader, SortIds,
|
||||
RemoveTranslatableInline, FilterSystemMessages, RefOnlyBulletListTransform,
|
||||
UnreferencedFootnotesDetector, SphinxSmartQuotes, ManpageLink
|
||||
UnreferencedFootnotesDetector, SphinxSmartQuotes, ManpageLink,
|
||||
SubstitutionDefinitionsRemover,
|
||||
] # type: List[Transform]
|
||||
|
||||
def __init__(self, app, *args, **kwargs):
|
||||
@ -116,7 +118,8 @@ class SphinxI18nReader(SphinxBaseReader):
|
||||
DefaultSubstitutions, MoveModuleTargets, HandleCodeBlocks,
|
||||
AutoNumbering, SortIds, RemoveTranslatableInline,
|
||||
FilterSystemMessages, RefOnlyBulletListTransform,
|
||||
UnreferencedFootnotesDetector, SphinxSmartQuotes, ManpageLink]
|
||||
UnreferencedFootnotesDetector, SphinxSmartQuotes, ManpageLink,
|
||||
SubstitutionDefinitionsRemover]
|
||||
|
||||
def set_lineno_for_reporter(self, lineno):
|
||||
# type: (int) -> None
|
||||
|
@ -16,10 +16,7 @@ from sphinx.transforms import SphinxTransform
|
||||
|
||||
|
||||
class SubstitutionDefinitionsRemover(SphinxTransform):
|
||||
"""Remove ``substitution_definition node from doctrees.
|
||||
|
||||
.. note:: In Sphinx-1.7, this transform is only used in LaTeX builder.
|
||||
"""
|
||||
"""Remove ``substitution_definition node from doctrees."""
|
||||
|
||||
# should be invoked after Substitutions process
|
||||
default_priority = Substitutions.default_priority + 1
|
||||
|
Loading…
Reference in New Issue
Block a user