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

Remove HTMLTranslator and html5_ready from sphinx.builders.html #11383

Merged
merged 2 commits into from Apr 28, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -28,6 +28,8 @@ Incompatible changes
* #11381: Remove deprecated ``style`` key for HTML templates.
* #11382: Remove deprecated ``sphinx.writers.latex.LaTeXTranslator.docclasses``
attribute.
* #11383: Remove deprecated ``sphinx.builders.html.html5_ready`` and
``sphinx.builders.html.HTMLTranslator`` attributes.

Deprecated
----------
Expand Down
18 changes: 0 additions & 18 deletions sphinx/builders/html/__init__.py
Expand Up @@ -1397,21 +1397,3 @@ def setup(app: Sphinx) -> dict[str, Any]:
'parallel_read_safe': True,
'parallel_write_safe': True,
}


# deprecated name -> (object to return, canonical path or empty string)
_DEPRECATED_OBJECTS = {
'html5_ready': (True, ''),
'HTMLTranslator': (HTML4Translator, 'sphinx.writers.html.HTML5Translator'),
}


def __getattr__(name):
if name not in _DEPRECATED_OBJECTS:
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')

from sphinx.deprecation import _deprecation_warning

deprecated_object, canonical_name = _DEPRECATED_OBJECTS[name]
_deprecation_warning(__name__, name, canonical_name, remove=(7, 0))
return deprecated_object