diff --git a/doc/Makefile b/doc/Makefile index 0808b6736b5ea9b13d95cd6352c40c735010d0a2..9795b90275b4ea7e86aa3f90370eb8fb0f039c74 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -6,6 +6,7 @@ SPHINXOPTS = -q -t solutions SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build +LESSC = lessc # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 @@ -41,7 +42,13 @@ help: clean: -rm -rf $(BUILDDIR)/* -html: +STATICS = _extensions/odoo_ext/static +# TODO: add bootstrap files +LESSFILES = $(wildcard $(STATICS)/*.less) +$(STATICS)/style.css: $(LESSFILES) + $(LESSC) $(STATICS)/style.less $(STATICS)/style.css + +html: _extensions/odoo_ext/static/style.css $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff --git a/doc/_extensions/odoo_ext/__init__.py b/doc/_extensions/odoo_ext/__init__.py index c1637623e62b6f5e858617e6c85f13d30efe858d..474931ae0fb2ff9ba7a2c6b6081816a3c466f2ab 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): diff --git a/doc/_extensions/odoo_ext/static/layout.less b/doc/_extensions/odoo_ext/static/layout.less index 4c8a5c643869c9e8640ca49f36ef88dbc2fc1653..033468afa4ec8f2865eeae27c7ca4d5757de2bff 100644 --- a/doc/_extensions/odoo_ext/static/layout.less +++ b/doc/_extensions/odoo_ext/static/layout.less @@ -151,31 +151,27 @@ main.has_code_col{ } } -main.index .toctree-wrapper{ - @media screen and(min-width: @screen-md){ +main.index .toctree-wrapper { + display: flex; + flex-wrap: wrap; + justify-content: space-between; - > .row:first-child { //trigg first section - > .col-md-3:nth-child(3), > .col-md-3:nth-child(5) { //trig cards (title + 2, title + 4) - margin-right: 50%; - } - } - position: relative; - .toc-single-entry{ - position: absolute; - top: 0; - right: 0; - width: 50%; - padding-right: floor((@grid-gutter-width / 2)); // compensate bootstrap default gutter - > .col-md-3 { - width: 100%; - } - > *[class^="col-"] { - padding-left: 0; //remove Bootstrap default gutter - } - .card { - min-height: (@card_min-height * 2 ) + @card_margin-bottom; + > .row { + flex: 1 0 100%; + } + @media screen and(min-width: @screen-md){ + // display these 2 as 2x2 squares + > .row.tutorials, .row.api { + flex: 0 0 50%; + + display: flex; + flex-wrap: wrap; + > div { + flex: 0 0 50%; } } + + // FIXME: reimplement a single big box (.toc-single-entry) } } diff --git a/doc/_extensions/odoo_ext/static/style.css b/doc/_extensions/odoo_ext/static/style.css index 1442d4bdd6756fb2b4b7a4f770653610c2809599..a3f34516f981637600ce45bbda0321bc70912973 100644 --- a/doc/_extensions/odoo_ext/static/style.css +++ b/doc/_extensions/odoo_ext/static/style.css @@ -9763,29 +9763,24 @@ main.has_code_col article.doc-body > section { color: #dcddde; } } +main.index .toctree-wrapper { + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +main.index .toctree-wrapper > .row { + flex: 1 0 100%; +} @media screen and (min-width: 992px) { - main.index .toctree-wrapper { - position: relative; - } - main.index .toctree-wrapper > .row:first-child > .col-md-3:nth-child(3), - main.index .toctree-wrapper > .row:first-child > .col-md-3:nth-child(5) { - margin-right: 50%; - } - main.index .toctree-wrapper .toc-single-entry { - position: absolute; - top: 0; - right: 0; - width: 50%; - padding-right: 15px; - } - main.index .toctree-wrapper .toc-single-entry > .col-md-3 { - width: 100%; + main.index .toctree-wrapper > .row.tutorials, + main.index .toctree-wrapper .row.api { + flex: 0 0 50%; + display: flex; + flex-wrap: wrap; } - main.index .toctree-wrapper .toc-single-entry > *[class^="col-"] { - padding-left: 0; - } - main.index .toctree-wrapper .toc-single-entry .card { - min-height: 420px; + main.index .toctree-wrapper > .row.tutorials > div, + main.index .toctree-wrapper .row.api > div { + flex: 0 0 50%; } } article.doc-toc .toctree-wrapper > ul > li > span { @@ -11782,23 +11777,6 @@ main.index .card:hover .card-img span { -o-transform: scale3d(1.02, 1.02, 1.02) translate3d(0, 0, 0); transform: scale3d(1.02, 1.02, 1.02) translate3d(0, 0, 0); } -@media screen and (min-width: 992px) { - main.index .toc-single-entry .card figcaption { - font-size: 1.5em; - padding: 20px 15px; - } -} -@media screen and (min-width: 992px) { - main.index .col-md-6 .card, - main.index .col-md-4 .card { - min-height: 300px; - } - main.index .col-md-6 .card figcaption, - main.index .col-md-4 .card figcaption { - font-size: 1.5em; - padding: 20px 15px; - } -} main.index.animating .card { -webkit-transform: scale3d(1, 1, 1) translate3d(0, 0, 0); -moz-transform: scale3d(1, 1, 1) translate3d(0, 0, 0); diff --git a/doc/_extensions/odoo_ext/static/style.less b/doc/_extensions/odoo_ext/static/style.less index 89d287d487ee37755cc33e3f379ef85a71a2bd44..719ee1441f57a9d62fcc684e705b20dc10aa5d32 100644 --- a/doc/_extensions/odoo_ext/static/style.less +++ b/doc/_extensions/odoo_ext/static/style.less @@ -336,23 +336,6 @@ main.index { } } - .toc-single-entry .card figcaption { - @media screen and(min-width: @screen-md){ - font-size: 1.5em; - padding: 20px 15px; - } - } - - .col-md-6 .card, .col-md-4 .card{ - @media screen and(min-width: @screen-md){ - min-height: 300px; - figcaption{ - font-size: 1.5em; - padding: 20px 15px; - } - } - } - &.animating .card { .transform(scale3d(1, 1, 1) translate3d(0, 0, 0)); } diff --git a/doc/conf.py b/doc/conf.py index e1621053cd1b88c8954e4ea27ad2a74f170e3d7a..8cafdc10a7cf3704d2204865387125317dfbd1ab 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -54,9 +54,9 @@ copyright = u'Odoo S.A.' # built documents. # # The short X.Y version. -version = '10.0' +version = '11.0' # The full version, including alpha/beta/rc tags. -release = '10.0' +release = '11.0' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/doc/reference.rst b/doc/reference.rst index 1b41f4cdbd24a0eb85bc27f7ddc36ec53d43b862..11712bebc6ceb305e0098221369edc0133d622b5 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -1,3 +1,5 @@ +:types: reference + ========= Reference =========