summaryrefslogtreecommitdiff
path: root/doc/_themes
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2014-11-17 17:31:12 +0100
committerChristophe Simonis <chs@odoo.com>2014-11-17 17:31:12 +0100
commitd64fe8279b4a1d3083a87b7e5fb211ddbbae50ca (patch)
tree207e10e9f6f69206862c6329a5dcd25be5d15f9b /doc/_themes
parentb2563509ffd89fdadc1256cb8118d7106f36e2e3 (diff)
parentc92e70b929376ba742ea17187ec521cf706302e5 (diff)
[MERGE] forward port of branch 8.0 up to c92e70b
Diffstat (limited to 'doc/_themes')
-rw-r--r--doc/_themes/odoodoc/layout.html5
-rw-r--r--doc/_themes/odoodoc/sphinx_monkeypatch.py43
-rw-r--r--doc/_themes/odoodoc/static/style.css115
-rw-r--r--doc/_themes/odoodoc/static/style.less73
4 files changed, 182 insertions, 54 deletions
diff --git a/doc/_themes/odoodoc/layout.html b/doc/_themes/odoodoc/layout.html
index 7685d8af25f..1a68d31814a 100644
--- a/doc/_themes/odoodoc/layout.html
+++ b/doc/_themes/odoodoc/layout.html
@@ -32,7 +32,7 @@
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
{{ toctree(maxdepth=4, collapse=False, includehidden=True,
- main_navbar=False, titles_only=False) }}
+ navbar='side', titles_only=False) }}
{% if github_link %}
<p><a href="{{ github_link(mode='edit') }}" class="github">
Edit on GitHub
@@ -72,7 +72,8 @@
{% endif %}
</div>
<nav class="collapse navbar-collapse navbar-main" role="navigation">
- {{ toctree(titles_only=True, maxdepth=2, includehidden=True, collapse=False) }}
+ {{ toctree(titles_only=True, maxdepth=2, includehidden=True,
+ collapse=False, navbar='main') }}
</nav>
</div>
</header>
diff --git a/doc/_themes/odoodoc/sphinx_monkeypatch.py b/doc/_themes/odoodoc/sphinx_monkeypatch.py
index 13c3a305988..182fef89c8d 100644
--- a/doc/_themes/odoodoc/sphinx_monkeypatch.py
+++ b/doc/_themes/odoodoc/sphinx_monkeypatch.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import sphinx.roles
import sphinx.environment
-from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.writers.html import HTMLTranslator
from docutils.writers.html4css1 import HTMLTranslator as DocutilsTranslator
@@ -9,27 +8,17 @@ def patch():
# navify toctree (oh god)
@monkey(sphinx.environment.BuildEnvironment)
def resolve_toctree(old_resolve, self, *args, **kwargs):
- """ If main_navbar, bootstrapify TOC to yield a navbar
+ """ If navbar, bootstrapify TOC to yield a navbar
"""
- main_navbar = kwargs.pop('main_navbar', False)
+ navbar = kwargs.pop('navbar', None)
toc = old_resolve(self, *args, **kwargs)
if toc is None:
return None
- navbarify(toc[0], main_navbar=main_navbar)
+ navbarify(toc[0], navbar=navbar)
return toc
- @monkey(StandaloneHTMLBuilder)
- def _get_local_toctree(old_local, self, *args, **kwargs):
- """ _get_local_toctree generates a documentation toctree for the local
- document (?), called from handle_page
- """
- # so can call toctree(main_navbar=False)
- d = {'main_navbar': True}
- d.update(kwargs)
- return old_local(self, *args, **d)
-
# monkeypatch visit_table to remove border and add .table
HTMLTranslator.visit_table = visit_table
# disable colspec crap
@@ -37,11 +26,18 @@ def patch():
# copy data- attributes straight from source to dest
HTMLTranslator.starttag = starttag_data
-def navbarify(node, main_navbar=False):
- # add classes to toplevel
- if not main_navbar:
- navify([node])
- else:
+def navbarify(node, navbar=None):
+ """
+ :param node: toctree node to navbarify
+ :param navbar: Whether this toctree is a 'main' navbar, a 'side' navbar or
+ not a navbar at all
+ """
+ if navbar == 'side':
+ for n in node.traverse():
+ if n.tagname == 'bullet_list':
+ n['classes'].append('nav')
+ elif navbar == 'main':
+ # add classes to just toplevel
node['classes'].extend(['nav', 'navbar-nav', 'navbar-right'])
for list_item in node.children:
# bullet_list
@@ -52,6 +48,10 @@ def navbarify(node, main_navbar=False):
# list_item
# compact_paragraph
# reference
+ # no bullet_list.list_item -> don't dropdownify
+ if not list_item.children[1].children:
+ return
+
list_item['classes'].append('dropdown')
# list_item.compact_paragraph.reference
link = list_item.children[0].children[0]
@@ -59,11 +59,6 @@ def navbarify(node, main_navbar=False):
link.attributes['data-toggle'] = 'dropdown'
# list_item.bullet_list
list_item.children[1]['classes'].append('dropdown-menu')
-def navify(nodes):
- for node in nodes:
- if node.tagname == 'bullet_list':
- node['classes'].append('nav')
- navify(node.children)
def visit_table(self, node):
"""
diff --git a/doc/_themes/odoodoc/static/style.css b/doc/_themes/odoodoc/static/style.css
index 19f5270109e..7c0b8e82959 100644
--- a/doc/_themes/odoodoc/static/style.css
+++ b/doc/_themes/odoodoc/static/style.css
@@ -5902,8 +5902,10 @@ button.close {
.panel-body:after,
.modal-footer:before,
.modal-footer:after,
-.document-super:before,
-.document-super:after,
+.document-super:not(.stripe):before,
+.document-super:not(.stripe):after,
+.document-super.stripe:before,
+.document-super.stripe:after,
.document:before,
.document:after {
content: " ";
@@ -5924,7 +5926,8 @@ button.close {
.pager:after,
.panel-body:after,
.modal-footer:after,
-.document-super:after,
+.document-super:not(.stripe):after,
+.document-super.stripe:after,
.document:after {
clear: both;
}
@@ -6181,35 +6184,53 @@ body {
overflow: auto;
position: relative;
}
-.document-super {
+.document-super:not(.stripe) {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
@media (min-width: 768px) {
- .document-super {
+ .document-super:not(.stripe) {
width: 750px;
}
}
@media (min-width: 992px) {
- .document-super {
+ .document-super:not(.stripe) {
width: 970px;
}
}
@media (min-width: 1200px) {
- .document-super {
+ .document-super:not(.stripe) {
width: 1170px;
}
}
-.document-super > .navbar-header,
-.document-super > .navbar-collapse {
+.document-super:not(.stripe) > .navbar-header,
+.document-super:not(.stripe) > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
- .document-super > .navbar-header,
- .document-super > .navbar-collapse {
+ .document-super:not(.stripe) > .navbar-header,
+ .document-super:not(.stripe) > .navbar-collapse {
+ margin-right: 0;
+ margin-left: 0;
+ }
+}
+.document-super.stripe {
+ margin-right: auto;
+ margin-left: auto;
+ padding-left: 15px;
+ padding-right: 15px;
+}
+.document-super.stripe > .navbar-header,
+.document-super.stripe > .navbar-collapse {
+ margin-right: -15px;
+ margin-left: -15px;
+}
+@media (min-width: 768px) {
+ .document-super.stripe > .navbar-header,
+ .document-super.stripe > .navbar-collapse {
margin-right: 0;
margin-left: 0;
}
@@ -6296,7 +6317,7 @@ body {
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
-.docs-nav .navbar-nav > li > a:after {
+.docs-nav .navbar-nav > li.dropdown > a:after {
content: " ";
display: inline-block;
width: 0;
@@ -6307,7 +6328,7 @@ body {
border-right: 4px solid transparent;
border-left: 4px solid transparent;
}
-.docs-nav .navbar-nav > li .dropdown-menu > li.current > a.current {
+.docs-nav .navbar-nav > li.dropdown .dropdown-menu > li.current > a.current {
background-color: #a24689;
color: white;
}
@@ -6709,6 +6730,74 @@ td.field-body > ul {
.descclassname {
opacity: 0.5;
}
+.index-tree ul,
+.index-tree li {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+.index-tree > ul > li {
+ margin-bottom: 0.5em;
+}
+.index-tree > ul > li > a {
+ font-family: Lato, Arial, sans-serif;
+ font-weight: 500;
+ line-height: 1.1;
+ color: inherit;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ font-size: 24px;
+ text-align: center;
+}
+.index-tree > ul > li > a small,
+.index-tree > ul > li > a .small {
+ font-weight: normal;
+ line-height: 1;
+ color: #777777;
+}
+.index-tree > ul > li > a small,
+.index-tree > ul > li > a .small {
+ font-size: 65%;
+}
+.index-tree > ul > li > ul {
+ display: -webkit-flex;
+ display: flex;
+ -webkit-flex-wrap: wrap;
+ flex-wrap: wrap;
+}
+.index-tree > ul > li > ul > li {
+ width: 50%;
+}
+.index-tree > ul > li > ul > li a {
+ font-family: Lato, Arial, sans-serif;
+ font-weight: 500;
+ line-height: 1.1;
+ color: inherit;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ font-size: 18px;
+ padding-left: 10%;
+ padding-right: 10%;
+}
+.index-tree > ul > li > ul > li a small,
+.index-tree > ul > li > ul > li a .small {
+ font-weight: normal;
+ line-height: 1;
+ color: #777777;
+}
+.index-tree > ul > li > ul > li a small,
+.index-tree > ul > li > ul > li a .small {
+ font-size: 75%;
+}
+.index-tree > ul > li a {
+ display: block;
+ color: #a24689 !important;
+ padding: 0.3em 0;
+ margin: 3px !important;
+}
+.index-tree > ul > li a:hover {
+ background-color: #eeeeee;
+}
.stripe .section {
margin-bottom: 2em;
}
diff --git a/doc/_themes/odoodoc/static/style.less b/doc/_themes/odoodoc/static/style.less
index 719fa6f10e3..ea53cd95e85 100644
--- a/doc/_themes/odoodoc/static/style.less
+++ b/doc/_themes/odoodoc/static/style.less
@@ -25,9 +25,12 @@ body {
position: relative;
}
-.document-super {
+.document-super:not(.stripe) {
.container();
}
+.document-super.stripe {
+ .container-fluid();
+}
.document {
.make-row();
@@ -89,20 +92,22 @@ body {
opacity: 0;
.transition(all 0.3s ease-out);
}
- > a:after {
- content: " ";
- display: inline-block;
- width: 0;
- height: 0;
- margin-left: 5px;
- vertical-align: middle;
- border-top: 4px solid @gray-light;
- border-right: 4px solid transparent;
- border-left: 4px solid transparent;
- }
- .dropdown-menu > li.current > a.current {
- background-color: @brand-primary;
- color: white;
+ &.dropdown {
+ > a:after {
+ content: " ";
+ display: inline-block;
+ width: 0;
+ height: 0;
+ margin-left: 5px;
+ vertical-align: middle;
+ border-top: 4px solid @gray-light;
+ border-right: 4px solid transparent;
+ border-left: 4px solid transparent;
+ }
+ .dropdown-menu > li.current > a.current {
+ background-color: @brand-primary;
+ color: white;
+ }
}
}
/* version switcher */
@@ -547,6 +552,44 @@ td.field-body {
opacity: 0.5;
}
+
+.index-tree {
+ ul, li {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ }
+ > ul > li {
+ margin-bottom: 0.5em;
+ > a {
+ .h3();
+ text-align: center;
+ }
+ > ul {
+ display: -webkit-flex;
+ display: flex;
+ -webkit-flex-wrap: wrap;
+ flex-wrap: wrap;
+ > li {
+ width: 50%;
+ a {
+ .h4();
+ padding-left: 10%;
+ padding-right: 10%;
+ }
+ }
+ }
+ a {
+ display: block;
+ color: @link-color !important;
+ padding: 0.3em 0;
+ margin: 3px !important;
+ &:hover {
+ background-color: @gray-lighter;
+ }
+ }
+ }
+}
// STRIPE-STYLE PAGES
.stripe {
.section {