diff options
| author | Adam Turner <9087854+AA-Turner@users.noreply.github.com> | 2022-12-30 00:53:04 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-30 00:53:04 +0000 |
| commit | bf06d7ef4d808c1e743267c38b5faed08cf3f21a (patch) | |
| tree | 0d41419b5bd57b9124ad4fcf1619b23f3f7ed23c /sphinx/builders/html | |
| parent | aa2fa38feff75cf1f87755bf17417cd05c0be683 (diff) | |
| download | sphinx-git-bf06d7ef4d808c1e743267c38b5faed08cf3f21a.tar.gz | |
Factor out HTML 4 translator (#11051)
Move the HTML 4 translator into a private module.
Diffstat (limited to 'sphinx/builders/html')
| -rw-r--r-- | sphinx/builders/html/__init__.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py index 7ea70fa4d..2fb1b3655 100644 --- a/sphinx/builders/html/__init__.py +++ b/sphinx/builders/html/__init__.py @@ -43,7 +43,8 @@ from sphinx.util.inventory import InventoryFile from sphinx.util.matching import DOTFILES, Matcher, patmatch from sphinx.util.osutil import copyfile, ensuredir, os_path, relative_uri from sphinx.util.tags import Tags -from sphinx.writers.html import HTMLTranslator, HTMLWriter +from sphinx.writers._html4 import HTML4Translator +from sphinx.writers.html import HTMLWriter from sphinx.writers.html5 import HTML5Translator #: the filename for the inventory of objects @@ -372,7 +373,7 @@ class StandaloneHTMLBuilder(Builder): @property def default_translator_class(self) -> Type[nodes.NodeVisitor]: # type: ignore if self.config.html4_writer: - return HTMLTranslator # RemovedInSphinx70Warning + return HTML4Translator # RemovedInSphinx70Warning else: return HTML5Translator @@ -1326,8 +1327,12 @@ import sphinx.builders.singlehtml # noqa: E402,F401 deprecated_alias('sphinx.builders.html', { 'html5_ready': True, + 'HTMLTranslator': HTML4Translator, }, - RemovedInSphinx70Warning) + RemovedInSphinx70Warning, + { + 'HTMLTranslator': 'sphinx.writers.html.HTML5Translator', + }) def setup(app: Sphinx) -> Dict[str, Any]: |
