Debian Codegraph @

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

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