Debian Codegraph @

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

raw
1 {#- Template for "Attributes" sections in docstrings.
2
3 This template renders a list of documented attributes 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("Attributes:") }}</th>
29 <td class="field-body">
30 <ul class="first simple">
31 {% for attribute in section.value %}
32 <li>
33 <b><code>{{ attribute.name }}</code></b>
34 {% if attribute.annotation %}
35 {% with expression = attribute.annotation %}
36 (<code>{% include "expression.html.jinja" with context %}</code>)
37 {% endwith %}
38 {% endif %}
39 –
40 <div class="doc-md-description">
41 {{ attribute.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
42 </div>
43 </li>
44 {% endfor %}
45 </ul>
46 </td>
47 </tr>
48 </tbody>
49 </table>