diff options
| author | Xavier Morel <xmo@odoo.com> | 2017-10-12 15:07:49 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2017-10-12 15:11:26 +0200 |
| commit | db0cb1b09237b2e004c7a7eceadedde668f4ac30 (patch) | |
| tree | 14ef5a75fcfaae20804796459c4eade2c334d892 /doc/_extensions/odoo_ext/__init__.py | |
| parent | e3dd0dee426405fe365b3c355b481d1fe36721a1 (diff) | |
[FIX] doc: various
* fix Sphinx 1.6 compatibility leading to the "tiles" on the home page
not working anymore: 1.6 replaces BuildEnvironment.reolve_toctree by
TocTree().resolve(), while the method still exists it's not actually
called anymore
* rejigger some CSS as the second section went from one big tile to 3
smaller tiles, and got laid out as a row rather than a second 2x2
block. Recode the entire mess with flexbox, remove some stuff which
conflicted with boostrap (this screen should probably be
de-boostrapped and completely converted to flexbox or grid)
* add building CSS from LESS to the makefile, all Odoo devs should
have less installed locally (for assets)
Diffstat (limited to 'doc/_extensions/odoo_ext/__init__.py')
| -rw-r--r-- | doc/_extensions/odoo_ext/__init__.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/_extensions/odoo_ext/__init__.py b/doc/_extensions/odoo_ext/__init__.py index c1637623e62..474931ae0fb 100644 --- a/doc/_extensions/odoo_ext/__init__.py +++ b/doc/_extensions/odoo_ext/__init__.py @@ -5,6 +5,10 @@ from . import switcher from . import translator import sphinx.environment +try: + from sphinx.environment.adapters import toctree +except ImportError: + pass import sphinx.builders.html from docutils import nodes def setup(app): @@ -93,6 +97,14 @@ class monkey(object): old = getattr(self.obj, name) setattr(self.obj, name, lambda self_, *args, **kwargs: \ fn(old, self_, *args, **kwargs)) +if toctree: + # 1.6 and above use a new toctree adapter object for processing rather + # than functions on the BuildEnv & al + @monkey(toctree.TocTree) + def resolve(old_resolve, tree, docname, *args, **kwargs): + if docname == tree.env.config.master_doc: + return resolve_content_toctree(tree.env, docname, *args, **kwargs) + return old_resolve(tree, docname, *args, **kwargs) @monkey(sphinx.environment.BuildEnvironment) def resolve_toctree(old_resolve, self, docname, *args, **kwargs): |
