mirror of
https://github.com/odoo/documentation.git
synced 2025-12-12 07:29:27 +07:00
[IMP] developer/javascript: unify the styling of API references
Now that a new styling for API references was added with commit934f45c, we can remove the extra CSS that was crafted specifically for JavaScript API references with commit05a0a49a. 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 commit120ae785. closes odoo/documentation#2378 X-original-commit:31a9d4a340Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
2
conf.py
2
conf.py
@@ -238,7 +238,7 @@ html_permalinks = True # Sphinx >= 3.5
|
|||||||
# Additional JS & CSS files that can be imported with the 'custom-js' and 'custom-css' metadata.
|
# 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.
|
# Lists are empty because the files are specified in extensions/themes.
|
||||||
html_js_files = []
|
html_js_files = []
|
||||||
html_css_files = ["css/js.css"]
|
html_css_files = []
|
||||||
|
|
||||||
# PHP lexer option to not require <?php
|
# PHP lexer option to not require <?php
|
||||||
highlight_options = {
|
highlight_options = {
|
||||||
|
|||||||
@@ -329,6 +329,8 @@ manifest counterparts.
|
|||||||
|
|
||||||
.. autoclass:: odoo.addons.base.models.ir_asset.IrAsset
|
.. autoclass:: odoo.addons.base.models.ir_asset.IrAsset
|
||||||
|
|
||||||
|
.. rst-class:: o-definition-list
|
||||||
|
|
||||||
`name`
|
`name`
|
||||||
Name of the asset record (for identification purpose).
|
Name of the asset record (for identification purpose).
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,8 @@ variables for various data points:
|
|||||||
|
|
||||||
.. warning:: ``$as`` will be replaced by the name passed to ``t-as``
|
.. warning:: ``$as`` will be replaced by the name passed to ``t-as``
|
||||||
|
|
||||||
|
.. rst-class:: o-definition-list
|
||||||
|
|
||||||
:samp:`{$as}_all` (deprecated)
|
:samp:`{$as}_all` (deprecated)
|
||||||
the object being iterated over
|
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
|
on the output node. This is done via the ``t-att`` (attribute) directive which
|
||||||
exists in 3 different forms:
|
exists in 3 different forms:
|
||||||
|
|
||||||
|
.. rst-class:: o-definition-list
|
||||||
|
|
||||||
:samp:`t-att-{$name}`
|
:samp:`t-att-{$name}`
|
||||||
an attribute called ``$name`` is created, the attribute value is evaluated
|
an attribute called ``$name`` is created, the attribute value is evaluated
|
||||||
and the result is set as the attribute's value::
|
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
|
Deprecated output directives
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
|
.. rst-class:: o-definition-list
|
||||||
|
|
||||||
``esc``
|
``esc``
|
||||||
An alias for ``out``, would originally HTML-escape its input. Not yet
|
An alias for ``out``, would originally HTML-escape its input. Not yet
|
||||||
formally deprecated as the only difference between ``out`` and ``esc`` is
|
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
|
Debugging
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
.. rst-class:: o-definition-list
|
||||||
|
|
||||||
``t-debug``
|
``t-debug``
|
||||||
invokes a debugger using PDB's ``set_trace`` API. The parameter should
|
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::
|
be the name of a module, on which a ``set_trace`` method is called::
|
||||||
@@ -751,6 +759,8 @@ At a deeper level than the previous helper is the ``_render`` method on
|
|||||||
You can use ``minimal_qcontext=False`` option to avoid this default
|
You can use ``minimal_qcontext=False`` option to avoid this default
|
||||||
value like the public method ``render``:
|
value like the public method ``render``:
|
||||||
|
|
||||||
|
.. rst-class:: o-definition-list
|
||||||
|
|
||||||
``request``
|
``request``
|
||||||
the current :class:`~odoo.http.Request` object, if any
|
the current :class:`~odoo.http.Request` object, if any
|
||||||
``debug``
|
``debug``
|
||||||
@@ -875,6 +885,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
|
on the extended template to select *context nodes* to which the specified
|
||||||
``t-operation`` is applied:
|
``t-operation`` is applied:
|
||||||
|
|
||||||
|
.. rst-class:: o-definition-list
|
||||||
|
|
||||||
``append``
|
``append``
|
||||||
the node's body is appended at the end of the context node (after the
|
the node's body is appended at the end of the context node (after the
|
||||||
context node's last child)
|
context node's last child)
|
||||||
@@ -907,6 +919,8 @@ debugging
|
|||||||
|
|
||||||
The javascript QWeb implementation provides a few debugging hooks:
|
The javascript QWeb implementation provides a few debugging hooks:
|
||||||
|
|
||||||
|
.. rst-class:: o-definition-list
|
||||||
|
|
||||||
``t-log``
|
``t-log``
|
||||||
takes an expression parameter, evaluates the expression during rendering
|
takes an expression parameter, evaluates the expression during rendering
|
||||||
and logs its result with ``console.log``::
|
and logs its result with ``console.log``::
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user