mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #2868 from tk0miya/deprecate_html_translator_class
deprecate `html_translator_class`
This commit is contained in:
commit
b8807ed9f9
2
CHANGES
2
CHANGES
@ -44,6 +44,8 @@ Incompatible changes
|
||||
* Fix ``genindex.html`` to satisfy xhtml standard.
|
||||
* Use epub3 builder by default. And the old epub builder is renamed to epub2.
|
||||
* Fix ``epub`` and ``epub3`` builders that contained links to ``genindex`` even if ``epub_use_index = False``.
|
||||
* `html_translator_class` is now deprecated.
|
||||
Use `Sphinx.set_translator()` API instead.
|
||||
|
||||
Features added
|
||||
--------------
|
||||
|
@ -910,6 +910,11 @@ that use Sphinx's HTMLWriter class.
|
||||
|
||||
.. seealso:: :meth:`~sphinx.application.Sphinx.set_translator`
|
||||
|
||||
.. deprecated:: 1.5
|
||||
|
||||
Implement your translator as extension and use `Sphinx.set_translator`
|
||||
instead.
|
||||
|
||||
.. confval:: html_show_copyright
|
||||
|
||||
If true, "(C) Copyright ..." is shown in the HTML footer. Default is
|
||||
|
@ -1183,6 +1183,12 @@ class JSONHTMLBuilder(SerializingHTMLBuilder):
|
||||
SerializingHTMLBuilder.init(self)
|
||||
|
||||
|
||||
def validate_config_values(app):
|
||||
if app.config.html_translator_class:
|
||||
app.warn('html_translator_class is deprecated. '
|
||||
'Use Sphinx.set_translator() API instead.')
|
||||
|
||||
|
||||
def setup(app):
|
||||
# builders
|
||||
app.add_builder(StandaloneHTMLBuilder)
|
||||
@ -1191,6 +1197,8 @@ def setup(app):
|
||||
app.add_builder(PickleHTMLBuilder)
|
||||
app.add_builder(JSONHTMLBuilder)
|
||||
|
||||
app.connect('builder-inited', validate_config_values)
|
||||
|
||||
# config values
|
||||
app.add_config_value('html_theme', 'alabaster', 'html')
|
||||
app.add_config_value('html_theme_path', [], 'html')
|
||||
|
Loading…
Reference in New Issue
Block a user