Debian Codegraph @

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

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