Debian Codegraph @

src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html.jinja

raw
1 {#- Template for "Parameters" sections in docstrings.
2
3 This template renders a list of documented parameters in the format
4 specified with the [`docstring_section_style`][] configuration option.
5
6 Context:
7 section (griffe.DocstringSectionAttributes): The section to render.
8 -#}
9
10 {% block logs scoped %}
11 {#- Logging block.
12
13 This block can be used to log debug messages, deprecation messages, warnings, etc.
14 -#}
15 {{ log.debug() }}
16 {% endblock %}
17
18 {% import "language.html.jinja" as lang with context %}
19 {#- Language module providing the `t` translation method. -#}
20
21 <table class="field-list">
22 <colgroup>
23 <col class="field-name" />
24 <col class="field-body" />
25 </colgroup>
26 <tbody valign="top">
27 <tr class="field">
28 <th class="field-name">{{ section.title or lang.t("Parameters:") }}</th>
29 <td class="field-body">
30 <ul class="first simple">
31 {% for parameter in section.value %}
32 <li>
33 <b><code>{{ parameter.name }}</code></b>
34 {% if parameter.annotation %}
35 {% with expression = parameter.annotation, backlink_type = "used-by" %}
36 (<code>{% include "expression.html.jinja" with context %}</code>
37 {%- if parameter.default %}, {{ lang.t("default:") }}
38 {% with expression = parameter.default, backlink_type = "used-by" %}
39 <code>{% include "expression.html.jinja" with context %}</code>
40 {% endwith %}
41 {% endif %})
42 {% endwith %}
43 {% endif %}
44 –
45 <div class="doc-md-description">
46 {{ parameter.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
47 </div>
48 </li>
49 {% endfor %}
50 </ul>
51 </td>
52 </tr>
53 </tbody>
54 </table>