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 @@
{{ toctree(maxdepth=4, collapse=False, includehidden=True, - main_navbar=False, titles_only=False) }} + navbar='side', titles_only=False) }} {% if github_link %}

Edit on GitHub @@ -72,7 +72,8 @@ {% endif %}

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 { diff --git a/doc/modules/api_integration.rst b/doc/api_integration.rst similarity index 99% rename from doc/modules/api_integration.rst rename to doc/api_integration.rst index 21d0163ba46..12c5b56737e 100644 --- a/doc/modules/api_integration.rst +++ b/doc/api_integration.rst @@ -1,7 +1,7 @@ :classes: stripe =========== -Odoo as API +Web Service =========== Odoo is mostly extended internally via modules, but much of its features and @@ -250,8 +250,8 @@ the login. Calling methods =============== -The second — and most generally useful — is ``xmlrpc/2/object`` which is used -to call methods of odoo models via the ``execute_kw`` RPC function. +The second endpoint is ``xmlrpc/2/object``, is used to call methods of odoo +models via the ``execute_kw`` RPC function. Each call to ``execute_kw`` takes the following parameters: diff --git a/doc/images/view-on-github.png b/doc/images/view-on-github.png deleted file mode 100644 index 65a8d42363d..00000000000 Binary files a/doc/images/view-on-github.png and /dev/null differ diff --git a/doc/index.rst b/doc/index.rst index 3c1696020d6..56f58b6aa0d 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -4,38 +4,17 @@ odoo developer documentation Welcome to the Odoo developer documentation. -This documentation is incomplete and may contain errors, if you wish to -contribute, every page should have a :guilabel:`View on Github` link: - -.. image:: images/view-on-github.* - :align: center - -Through this link you can edit documents and submit changes for review using -`github's web interface -`_. -Contributions are welcome and appreciated. - .. todo:: what's the documentation's license? -The documentation is currently organized in four sections: - -* :doc:`tutorials`, aimed at introducing the primary areas of developing Odoo - modules -* :doc:`reference`, which ought be the complete and canonical documentation - for Odoo subsystems -* :doc:`modules`, documenting useful specialized modules and integration - methods (and currently empty) - -.. hidden toctree w/o titlesonly otherwise the titlesonly "sticks" to - in-document toctrees and we can't have a toctree showing both "sibling" - pages and current document sections - +.. rst-class:: index-tree +.. titlesonly breaks level 3 (~in-document) toc of left navbar, so use + maxdepth instead .. toctree:: - :hidden: + :maxdepth: 2 tutorials reference - modules + api_integration .. ifconfig:: todo_include_todos diff --git a/doc/modules.rst b/doc/modules.rst deleted file mode 100644 index cb5ed8d6ca1..00000000000 --- a/doc/modules.rst +++ /dev/null @@ -1,8 +0,0 @@ -============== -Module Objects -============== - -.. toctree:: - :titlesonly: - - modules/api_integration diff --git a/doc/reference/cmdline.rst b/doc/reference/cmdline.rst index 32c1ef48729..1ec7d96ae9d 100644 --- a/doc/reference/cmdline.rst +++ b/doc/reference/cmdline.rst @@ -71,7 +71,7 @@ Scaffolding is available via the :command:`odoo.py scaffold` subcommand. .. option:: -t