diff options
| author | Xavier Morel <xmo@odoo.com> | 2017-07-03 11:45:55 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2017-07-03 11:49:03 +0200 |
| commit | 9a07a4599ce08bd1e3a74579a982fa3a58dc6cb2 (patch) | |
| tree | 4608699ce4d61cf5680f9406776c6a1daf287298 /doc/_extensions/odoo_ext/__init__.py | |
| parent | 828c7c3da92970e3f0836a62f858ac2f5229947a (diff) | |
[FIX] doc warnings
* add Sphinx 1.6 compatibility (use app.set_translator when
available as in that case programmatically setting
html_translator_class is broken)
* fix a bunch of code block lexers to avoid warnings & get better
coloration
* add a few options which were referred to without being actually
defined
* fix some rST formatting
Diffstat (limited to 'doc/_extensions/odoo_ext/__init__.py')
| -rw-r--r-- | doc/_extensions/odoo_ext/__init__.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/doc/_extensions/odoo_ext/__init__.py b/doc/_extensions/odoo_ext/__init__.py index 0ec55620497..c1637623e62 100644 --- a/doc/_extensions/odoo_ext/__init__.py +++ b/doc/_extensions/odoo_ext/__init__.py @@ -8,10 +8,13 @@ import sphinx.environment import sphinx.builders.html from docutils import nodes def setup(app): - 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_ext.translator.BootstrapTranslator' + if hasattr(app, 'set_translator'): + app.set_translator('html', translator.BootstrapTranslator) + else: + 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_ext.translator.BootstrapTranslator' switcher.setup(app) app.add_config_value('odoo_cover_default', None, 'env') |
