From 9beaeddf606d0daac589561474a3799bb66f72c1 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 8 Jul 2015 11:48:40 +0200 Subject: [PATCH] [FIX] doc: new theme snags * fix handling of no banner (and no default banner) on documents: - don't try to build a banner URL at the top of document - don't build a mini-banner in cards * fix compatibility between custom HTML translator and domains creating new nodes (and their rendering): hook translator via app.add_translator so app.add_node can do the job correctly: with html_translator_class the application is not aware of the new HTML translator and add_node can't add the relevant rendering methods * add translation for line_block and line (classes not used, point is just to have a div for each line so "newlines" are kept --- doc/_extensions/odoo/__init__.py | 6 +++-- doc/_extensions/odoo/layout.html | 2 +- doc/_extensions/odoo/translator.py | 36 +++++++++++++++++++++++------- doc/conf.py | 1 - 4 files changed, 33 insertions(+), 12 deletions(-) diff --git a/doc/_extensions/odoo/__init__.py b/doc/_extensions/odoo/__init__.py index 125c2f55afb..e2600d744df 100644 --- a/doc/_extensions/odoo/__init__.py +++ b/doc/_extensions/odoo/__init__.py @@ -1,13 +1,15 @@ # -*- coding: utf-8 -*- -from . import switcher from . import pygments_override -import collections +from . import switcher +from . import translator import sphinx.environment import sphinx.builders.html from docutils import nodes def setup(app): + app.set_translator('html', translator.BootstrapTranslator) + switcher.setup(app) app.add_config_value('odoo_cover_default', None, 'env') app.add_config_value('odoo_cover_external', {}, 'env') diff --git a/doc/_extensions/odoo/layout.html b/doc/_extensions/odoo/layout.html index 0f9661ba6de..c14eab647eb 100644 --- a/doc/_extensions/odoo/layout.html +++ b/doc/_extensions/odoo/layout.html @@ -46,7 +46,7 @@ {%- block header -%}
- +