Debian Codegraph @

src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html.jinja

raw
1 {#- Template for "Other parameters" sections in docstrings.
2
3 This template renders a list of documented other 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("Rendering other parameters section") }}
16 {% endblock logs %}
17
18 {% import "language.html.jinja" as lang with context %}
19 {#- Language module providing the `t` translation method. -#}
20
21 {% if config.docstring_section_style == "table" %}
22 {% block table_style scoped %}
23 {#- Block for the `table` section style. -#}
24 <p><span class="doc-section-title">{{ section.title or lang.t("Other Parameters:") }}</span></p>
25 <table>
26 <thead>
27 <tr>
28 <th>{{ lang.t("Name") }}</th>
29 <th>{{ lang.t("Type") }}</th>
30 <th>{{ lang.t("Description") }}</th>
31 </tr>
32 </thead>
33 <tbody>
34 {% for parameter in section.value %}
35 <tr class="doc-section-item">
36 <td><code>{{ parameter.name }}</code></td>
37 <td>
38 {% if parameter.annotation %}
39 {% with expression = parameter.annotation, backlink_type = "used-by" %}
40 <code>{% include "expression.html.jinja" with context %}</code>
41 {% endwith %}
42 {% endif %}
43 </td>
44 <td>
45 <div class="doc-md-description">
46 {{ parameter.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
47 </div>
48 </td>
49 </tr>
50 {% endfor %}
51 </tbody>
52 </table>
53 {% endblock table_style %}
54 {% elif config.docstring_section_style == "list" %}
55 {% block list_style scoped %}
56 {#- Block for the `list` section style. -#}
57 <p><span class="doc-section-title">{{ section.title or lang.t("Other Parameters:") }}</span></p>
58 <ul>
59 {% for parameter in section.value %}
60 <li class="doc-section-item field-body">
61 <b><code>{{ parameter.name }}</code></b>
62 {% if parameter.annotation %}
63 {% with expression = parameter.annotation, backlink_type = "used-by" %}
64 (<code>{% include "expression.html.jinja" with context %}</code>)
65 {% endwith %}
66 {% endif %}
67 –
68 <div class="doc-md-description">
69 {{ parameter.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
70 </div>
71 </li>
72 {% endfor %}
73 </ul>
74 {% endblock list_style %}
75 {% elif config.docstring_section_style == "spacy" %}
76 {% block spacy_style scoped %}
77 {#- Block for the `spacy` section style. -#}
78 <table>
79 <thead>
80 <tr>
81 <th><span class="doc-section-title">{{ (section.title or lang.t("PARAMETER")).rstrip(":").upper() }}</span></th>
82 <th><span>{{ lang.t("DESCRIPTION") }}</span></th>
83 </tr>
84 </thead>
85 <tbody>
86 {% for parameter in section.value %}
87 <tr class="doc-section-item">
88 <td><code>{{ parameter.name }}</code></td>
89 <td class="doc-param-details">
90 <div class="doc-md-description">
91 {{ parameter.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
92 </div>
93 <p>
94 {% if parameter.annotation %}
95 <span class="doc-param-annotation">
96 <b>{{ lang.t("TYPE:") }}</b>
97 {% with expression = parameter.annotation, backlink_type = "used-by" %}
98 <code>{% include "expression.html.jinja" with context %}</code>
99 {% endwith %}
100 </span>
101 {% endif %}
102 </p>
103 </td>
104 </tr>
105 {% endfor %}
106 </tbody>
107 </table>
108 {% endblock spacy_style %}
109 {% endif %}