[FIX] 1.2 compatibility

app.add_node doesn't work right for custom translators in 1.2, since
mementos are using ``h:div`` reimplement that in the
BootstrapTranslator.

Alternative would be to monkeypatch app.add_node for Sphinx 1.2, but
let's not do that...
This commit is contained in:
Xavier Morel
2015-11-20 11:37:18 +01:00
parent fbea64a257
commit e2204cdd72
2 changed files with 16 additions and 1 deletions
+4 -1
View File
@@ -8,7 +8,10 @@ import sphinx.environment
import sphinx.builders.html
from docutils import nodes
def setup(app):
app.set_translator('html', translator.BootstrapTranslator)
if getattr(app.config, 'html_translator_class', None):
app.warn("Overriding the explicitly set html_translator_class setting",
location="odoo extension")
app.config.html_translator_class = 'odoo.translator.BootstrapTranslator'
switcher.setup(app)
app.add_config_value('odoo_cover_default', None, 'env')