Merge pull request #2868 from tk0miya/deprecate_html_translator_class

deprecate `html_translator_class`
This commit is contained in:
Takeshi KOMIYA 2016-08-24 19:36:48 +09:00 committed by GitHub
commit b8807ed9f9
3 changed files with 15 additions and 0 deletions

View File

@ -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
--------------

View File

@ -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

View File

@ -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')