[IMP] developer/javascript: unify the styling of API references

Now that a new styling for API references was added with commit 934f45c,
we can remove the extra CSS that was crafted specifically for JavaScript
API references with commit 05a0a49a. While we're at it, this commit also
applies the new styling to definition lists that were missing it, like
it was done for the page on views with commit 120ae785.

closes odoo/documentation#2367

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Antoine Vandevenne (anv) 2022-07-04 08:33:16 +00:00
parent 109817311e
commit 31a9d4a340
4 changed files with 17 additions and 43 deletions

View File

@ -237,7 +237,7 @@ html_permalinks = True # Sphinx >= 3.5
# Additional JS & CSS files that can be imported with the 'custom-js' and 'custom-css' metadata.
# Lists are empty because the files are specified in extensions/themes.
html_js_files = []
html_css_files = ["css/js.css"]
html_css_files = []
# PHP lexer option to not require <?php
highlight_options = {

View File

@ -329,6 +329,8 @@ manifest counterparts.
.. autoclass:: odoo.addons.base.models.ir_asset.IrAsset
.. rst-class:: o-definition-list
`name`
Name of the asset record (for identification purpose).

View File

@ -142,6 +142,8 @@ variables for various data points:
.. warning:: ``$as`` will be replaced by the name passed to ``t-as``
.. rst-class:: o-definition-list
:samp:`{$as}_all` (deprecated)
the object being iterated over
@ -198,6 +200,8 @@ QWeb can compute attributes on-the-fly and set the result of the computation
on the output node. This is done via the ``t-att`` (attribute) directive which
exists in 3 different forms:
.. rst-class:: o-definition-list
:samp:`t-att-{$name}`
an attribute called ``$name`` is created, the attribute value is evaluated
and the result is set as the attribute's value::
@ -442,6 +446,8 @@ to a normal string to "strip" the safety flag e.g. `str(content)` in Python and
Deprecated output directives
----------------------------
.. rst-class:: o-definition-list
``esc``
An alias for ``out``, would originally HTML-escape its input. Not yet
formally deprecated as the only difference between ``out`` and ``esc`` is
@ -483,6 +489,8 @@ is ``widget``, other options are field- or widget-dependent.
Debugging
---------
.. rst-class:: o-definition-list
``t-debug``
invokes a debugger using PDB's ``set_trace`` API. The parameter should
be the name of a module, on which a ``set_trace`` method is called::
@ -524,6 +532,8 @@ At a deeper level than the previous helper is the ``render`` method on
Sets up a number of default values in the rendering context:
.. rst-class:: o-definition-list
``request``
the current :class:`~odoo.http.WebRequest` object, if any
``debug``
@ -643,6 +653,8 @@ The ``t-jquery`` directives takes a `CSS selector`_. This selector is used
on the extended template to select *context nodes* to which the specified
``t-operation`` is applied:
.. rst-class:: o-definition-list
``append``
the node's body is appended at the end of the context node (after the
context node's last child)
@ -675,6 +687,8 @@ debugging
The javascript QWeb implementation provides a few debugging hooks:
.. rst-class:: o-definition-list
``t-log``
takes an expression parameter, evaluates the expression during rendering
and logs its result with ``console.log``::

View File

@ -1,42 +0,0 @@
/** temporary file while js doc is being written - subject to heavy changes **/
.js, .js.method, .js.function, .js.class { /** temp hack for nested apis - have to find a nice look for it **/
padding: 1rem !important;
border-radius: .25rem;
background-color: #F9FAFB;
border: 2px solid #017e84;
margin-left: 0;
}
.js dd div {
margin: 0 !important;
}
.js dl {
padding: 0 !important;
margin: 0;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
.js blockquote {
margin: 0;
}
.js > dd > p:before {
content: "-> ";
}
.js .field-list {
border: none !important;
}
.js .sig-param, .js .sig-paren {
font-style: normal;
font-size: initial;
color: #4B5563;
font-family: var(--bs-font-monospace);
}
.js .sig-paren {
color: #212529;
}