mkdocstrings-matlab 0.9.7__py3-none-any.whl → 1.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. mkdocstrings_handlers/matlab/__init__.py +26 -3
  2. mkdocstrings_handlers/matlab/config.py +885 -0
  3. mkdocstrings_handlers/matlab/handler.py +155 -296
  4. mkdocstrings_handlers/matlab/logger.py +111 -0
  5. mkdocstrings_handlers/matlab/rendering.py +818 -0
  6. mkdocstrings_handlers/matlab/templates/material/attributes.html.jinja +25 -0
  7. mkdocstrings_handlers/matlab/templates/material/backlinks.html.jinja +17 -0
  8. mkdocstrings_handlers/matlab/templates/material/children.html.jinja +70 -62
  9. mkdocstrings_handlers/matlab/templates/material/class.html.jinja +236 -0
  10. mkdocstrings_handlers/matlab/templates/material/docstring/admonition.html.jinja +20 -0
  11. mkdocstrings_handlers/matlab/templates/material/docstring/classes.html.jinja +85 -0
  12. mkdocstrings_handlers/matlab/templates/material/docstring/examples.html.jinja +27 -0
  13. mkdocstrings_handlers/matlab/templates/material/docstring/functions.html.jinja +91 -0
  14. mkdocstrings_handlers/matlab/templates/material/docstring/input_arguments.html.jinja +171 -0
  15. mkdocstrings_handlers/matlab/templates/material/docstring/name_value_arguments.html.jinja +166 -0
  16. mkdocstrings_handlers/matlab/templates/material/docstring/namespaces.html.jinja +5 -6
  17. mkdocstrings_handlers/matlab/templates/material/docstring/output_arguments.html.jinja +152 -0
  18. mkdocstrings_handlers/matlab/templates/material/docstring/properties.html.jinja +25 -26
  19. mkdocstrings_handlers/matlab/templates/material/docstring.html.jinja +53 -0
  20. mkdocstrings_handlers/matlab/templates/material/expression.html.jinja +55 -0
  21. mkdocstrings_handlers/matlab/templates/material/folder.html.jinja +31 -39
  22. mkdocstrings_handlers/matlab/templates/material/function.html.jinja +148 -0
  23. mkdocstrings_handlers/matlab/templates/material/language.html.jinja +18 -0
  24. mkdocstrings_handlers/matlab/templates/material/languages/en.html.jinja +38 -0
  25. mkdocstrings_handlers/matlab/templates/material/languages/ja.html.jinja +38 -0
  26. mkdocstrings_handlers/matlab/templates/material/languages/zh.html.jinja +38 -0
  27. mkdocstrings_handlers/matlab/templates/material/namespace.html.jinja +32 -38
  28. mkdocstrings_handlers/matlab/templates/material/property.html.jinja +39 -35
  29. mkdocstrings_handlers/matlab/templates/material/script.html.jinja +3 -25
  30. mkdocstrings_handlers/matlab/templates/material/signature.html.jinja +105 -0
  31. mkdocstrings_handlers/matlab/templates/material/style.css +179 -4
  32. mkdocstrings_handlers/matlab/templates/material/summary/classes.html.jinja +25 -0
  33. mkdocstrings_handlers/matlab/templates/material/summary/functions.html.jinja +25 -0
  34. mkdocstrings_handlers/matlab/templates/material/summary/namespaces.html.jinja +17 -13
  35. mkdocstrings_handlers/matlab/templates/material/summary/properties.html.jinja +17 -13
  36. mkdocstrings_handlers/matlab/templates/material/summary.html.jinja +6 -6
  37. {mkdocstrings_matlab-0.9.7.dist-info → mkdocstrings_matlab-1.0.1.dist-info}/METADATA +17 -21
  38. mkdocstrings_matlab-1.0.1.dist-info/RECORD +41 -0
  39. mkdocstrings_handlers/matlab/collect.py +0 -783
  40. mkdocstrings_handlers/matlab/enums.py +0 -54
  41. mkdocstrings_handlers/matlab/models.py +0 -633
  42. mkdocstrings_handlers/matlab/treesitter.py +0 -707
  43. mkdocstrings_matlab-0.9.7.dist-info/RECORD +0 -22
  44. {mkdocstrings_matlab-0.9.7.dist-info → mkdocstrings_matlab-1.0.1.dist-info}/WHEEL +0 -0
  45. {mkdocstrings_matlab-0.9.7.dist-info → mkdocstrings_matlab-1.0.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,91 @@
1
+ {#- Template for "Functions" sections in docstrings.
2
+
3
+ This template renders a list of documented functions 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 functions section") }}
16
+ {% endblock logs %}
17
+ {% import "language.html.jinja" as lang with context %}
18
+ {#- Language module providing the `t` translation method. -#}
19
+
20
+ {% if config.docstring_section_style == "table" %}
21
+ {% block table_style scoped %}
22
+ {#- Block for the `table` section style. -#}
23
+ <p><span class="doc-section-title">{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}</span></p>
24
+ <table>
25
+ <thead>
26
+ <tr>
27
+ <th>{{ lang.t("Name") }}</th>
28
+ <th>{{ lang.t("Description") }}</th>
29
+ </tr>
30
+ </thead>
31
+ <tbody>
32
+ {% for function in section.value %}
33
+ {% if not function.name == "__init__" or not config.merge_init_into_class %}
34
+ <tr class="doc-section-item">
35
+ <td><code><autoref identifier="{{ obj.path }}.{{ function.name }}" optional hover>{{ function.name }}</autoref></code></td>
36
+ <td>
37
+ <div class="doc-md-description">
38
+ {{ function.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
39
+ </div>
40
+ </td>
41
+ </tr>
42
+ {% endif %}
43
+ {% endfor %}
44
+ </tbody>
45
+ </table>
46
+ {% endblock table_style %}
47
+ {% elif config.docstring_section_style == "list" %}
48
+ {% block list_style scoped %}
49
+ {#- Block for the `list` section style. -#}
50
+ <p><span class="doc-section-title">{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}</span></p>
51
+ <ul>
52
+ {% for function in section.value %}
53
+ {% if not function.name == "__init__" or not config.merge_init_into_class %}
54
+ <li class="doc-section-item field-body">
55
+ <b><code><autoref identifier="{{ obj.path }}.{{ function.name }}" optional hover>{{ function.name }}</autoref></code></b>
56
+
57
+ <div class="doc-md-description">
58
+ {{ function.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
59
+ </div>
60
+ </li>
61
+ {% endif %}
62
+ {% endfor %}
63
+ </ul>
64
+ {% endblock list_style %}
65
+ {% elif config.docstring_section_style == "spacy" %}
66
+ {% block spacy_style scoped %}
67
+ {#- Block for the `spacy` section style. -#}
68
+ <table>
69
+ <thead>
70
+ <tr>
71
+ <th><span class="doc-section-title">{{ (section.title or lang.t("METHOD") if obj.is_class else lang.t("FUNCTION")).rstrip(":").upper() }}</span></th>
72
+ <th><span>{{ lang.t("DESCRIPTION") }}</span></th>
73
+ </tr>
74
+ </thead>
75
+ <tbody>
76
+ {% for function in section.value %}
77
+ {% if not function.name == "__init__" or not config.merge_init_into_class %}
78
+ <tr class="doc-section-item">
79
+ <td><code><autoref identifier="{{ obj.path }}.{{ function.name }}" optional hover>{{ function.name }}</autoref></code></td>
80
+ <td class="doc-function-details">
81
+ <div class="doc-md-description">
82
+ {{ function.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
83
+ </div>
84
+ </td>
85
+ </tr>
86
+ {% endif %}
87
+ {% endfor %}
88
+ </tbody>
89
+ </table>
90
+ {% endblock spacy_style %}
91
+ {% endif %}
@@ -0,0 +1,171 @@
1
+ {#- Template for "Input arguments" sections in docstrings.
2
+
3
+ This template renders a list of documented input arguments 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 input arguments section") }}
16
+ {% endblock logs %}
17
+ {% import "language.html.jinja" as lang with context %}
18
+ {#- Language module providing the `t` translation method. -#}
19
+
20
+ {% if config.docstring_section_style == "table" %}
21
+ {% block table_style scoped %}
22
+ {#- Block for the `table` section style. -#}
23
+ <p><span class="doc-section-title">{{ section.title or lang.t("Input arguments:") }}</span></p>
24
+ <table>
25
+ <thead>
26
+ <tr>
27
+ <th>{{ lang.t("Name") }}</th>
28
+ <th>{{ lang.t("Type") }}</th>
29
+ <th>{{ lang.t("Description") }}</th>
30
+ <th>{{ lang.t("Default") }}</th>
31
+ </tr>
32
+ </thead>
33
+ <tbody>
34
+ {% for argument in section.value %}
35
+ <tr class="doc-section-item">
36
+ <td>
37
+ {% if config.argument_headings %}
38
+ {% filter heading(
39
+ heading_level + 1,
40
+ role="argument",
41
+ id=html_id ~ "(" ~ argument.name ~ ")",
42
+ class="doc doc-heading doc-heading-argument",
43
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-argument"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + argument.name,
44
+ ) %}
45
+ <code>{{ argument.name }}</code>
46
+ {% endfilter %}
47
+ {% else %}
48
+ <code>{{ argument.name }}</code>
49
+ {% endif %}
50
+ </td>
51
+ <td>
52
+ {% if argument.annotation %}
53
+ {% with expression = argument.annotation, backlink_type = "used-by" %}
54
+ <code>{% include "expression.html.jinja" with context %}</code>
55
+ {% endwith %}
56
+ {% endif %}
57
+ </td>
58
+ <td>
59
+ <div class="doc-md-description">
60
+ {{ argument.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
61
+ </div>
62
+ </td>
63
+ <td>
64
+ {% if argument.default %}
65
+ {% with expression = argument.default, backlink_type = "used-by" %}
66
+ <code>{% include "expression.html.jinja" with context %}</code>
67
+ {% endwith %}
68
+ {% else %}
69
+ <em>{{ lang.t("required") }}</em>
70
+ {% endif %}
71
+ </td>
72
+ </tr>
73
+ {% endfor %}
74
+ </tbody>
75
+ </table>
76
+ {% endblock table_style %}
77
+ {% elif config.docstring_section_style == "list" %}
78
+ {% block list_style scoped %}
79
+ {#- Block for the `list` section style. -#}
80
+ <p><span class="doc-section-title">{{ section.title or lang.t("Input arguments:") }}</span></p>
81
+ <ul>
82
+ {% for argument in section.value %}
83
+ <li class="doc-section-item field-body">
84
+ {% if config.argument_headings %}
85
+ {% filter heading(
86
+ heading_level + 1,
87
+ role="argument",
88
+ id=html_id ~ "(" ~ argument.name ~ ")",
89
+ class="doc doc-heading doc-heading-argument",
90
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-argument"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + argument.name,
91
+ ) %}
92
+ <b><code>{{ argument.name }}</code></b>
93
+ {% endfilter %}
94
+ {% else %}
95
+ <b><code>{{ argument.name }}</code></b>
96
+ {% endif %}
97
+ {% if argument.annotation %}
98
+ {% with expression = argument.annotation, backlink_type = "used-by" %}
99
+ (<code>{% include "expression.html.jinja" with context %}</code>
100
+ {%- if argument.default %}, {{ lang.t("default:") }}
101
+ {% with expression = argument.default, backlink_type = "used-by" %}
102
+ <code>{% include "expression.html.jinja" with context %}</code>
103
+ {% endwith %}
104
+ {% endif %})
105
+ {% endwith %}
106
+ {% endif %}
107
+
108
+ <div class="doc-md-description">
109
+ {{ argument.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
110
+ </div>
111
+ </li>
112
+ {% endfor %}
113
+ </ul>
114
+ {% endblock list_style %}
115
+ {% elif config.docstring_section_style == "spacy" %}
116
+ {% block spacy_style scoped %}
117
+ {#- Block for the `spacy` section style. -#}
118
+ <table>
119
+ <thead>
120
+ <tr>
121
+ <th><span class="doc-section-title">{{ (section.title or lang.t("INPUT ARGUMENT")).rstrip(":").upper() }}</span></th>
122
+ <th><span>{{ lang.t("DESCRIPTION") }}</span></th>
123
+ </tr>
124
+ </thead>
125
+ <tbody>
126
+ {% for argument in section.value %}
127
+ <tr class="doc-section-item">
128
+ <td>
129
+ {% if config.argument_headings %}
130
+ {% filter heading(
131
+ heading_level + 1,
132
+ role="argument",
133
+ id=html_id ~ "(" ~ argument.name ~ ")",
134
+ class="doc doc-heading doc-heading-argument",
135
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-argument"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + argument.name,
136
+ ) %}
137
+ <code>{{ argument.name }}</code>
138
+ {% endfilter %}
139
+ {% else %}
140
+ <code>{{ argument.name }}</code>
141
+ {% endif %}
142
+ </td>
143
+ <td class="doc-argument-details">
144
+ <div class="doc-md-description">
145
+ {{ argument.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
146
+ </div>
147
+ <p>
148
+ {% if argument.annotation %}
149
+ <span class="doc-argument-annotation">
150
+ <b>{{ lang.t("TYPE:") }}</b>
151
+ {% with expression = argument.annotation, backlink_type = "used-by" %}
152
+ <code>{% include "expression.html.jinja" with context %}</code>
153
+ {% endwith %}
154
+ </span>
155
+ {% endif %}
156
+ {% if argument.default %}
157
+ <span class="doc-argument-default">
158
+ <b>{{ lang.t("DEFAULT:") }}</b>
159
+ {% with expression = argument.default, backlink_type = "used-by" %}
160
+ <code>{% include "expression.html.jinja" with context %}</code>
161
+ {% endwith %}
162
+ </span>
163
+ {% endif %}
164
+ </p>
165
+ </td>
166
+ </tr>
167
+ {% endfor %}
168
+ </tbody>
169
+ </table>
170
+ {% endblock spacy_style %}
171
+ {% endif %}
@@ -0,0 +1,166 @@
1
+ {#- Template for "Name-value arguments" sections in docstrings.
2
+
3
+ This template renders a list of documented name-value arguments 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 name-value arguments section") }}
16
+ {% endblock logs %}
17
+ {% import "language.html.jinja" as lang with context %}
18
+ {#- Language module providing the `t` translation method. -#}
19
+
20
+ {% if config.docstring_section_style == "table" %}
21
+ {% block table_style scoped %}
22
+ {#- Block for the `table` section style. -#}
23
+ <p><span class="doc-section-title">{{ section.title or lang.t("Name-value arguments:") }}</span></p>
24
+ <table>
25
+ <thead>
26
+ <tr>
27
+ <th>{{ lang.t("Name") }}</th>
28
+ <th>{{ lang.t("Type") }}</th>
29
+ <th>{{ lang.t("Description") }}</th>
30
+ <th>{{ lang.t("Default") }}</th>
31
+ </tr>
32
+ </thead>
33
+ <tbody>
34
+ {% for argument in section.value %}
35
+ <tr class="doc-section-item">
36
+ <td>
37
+ {% if config.argument_headings %}
38
+ {% filter heading(
39
+ heading_level + 1,
40
+ role="argument",
41
+ id=html_id ~ "(" ~ argument.name ~ ")",
42
+ class="doc doc-heading doc-heading-argument",
43
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-argument"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + argument.name,
44
+ ) %}
45
+ <code>{{ argument.name }}</code>
46
+ {% endfilter %}
47
+ {% else %}
48
+ <code>{{ argument.name }}</code>
49
+ {% endif %}
50
+ </td>
51
+ <td>
52
+ {% if argument.annotation %}
53
+ {% with expression = argument.annotation, backlink_type = "used-by" %}
54
+ <code>{% include "expression.html.jinja" with context %}</code>
55
+ {% endwith %}
56
+ {% endif %}
57
+ </td>
58
+ <td>
59
+ <div class="doc-md-description">
60
+ {{ argument.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
61
+ </div>
62
+ </td>
63
+ <td>
64
+ {% if argument.default %}
65
+ {% with expression = argument.default, backlink_type = "used-by" %}
66
+ <code>{% include "expression.html.jinja" with context %}</code>
67
+ {% endwith %}
68
+ {% else %}
69
+ <em>{{ lang.t("none") }}</em>
70
+ {% endif %}
71
+ </td>
72
+ </tr>
73
+ {% endfor %}
74
+ </tbody>
75
+ </table>
76
+ {% endblock table_style %}
77
+ {% elif config.docstring_section_style == "list" %}
78
+ {% block list_style scoped %}
79
+ {#- Block for the `list` section style. -#}
80
+ <p><span class="doc-section-title">{{ section.title or lang.t("Name-value arguments:") }}</span></p>
81
+ <ul>
82
+ {% for argument in section.value %}
83
+ <li class="doc-section-item field-body">
84
+ {% if config.argument_headings %}
85
+ {% filter heading(
86
+ heading_level + 1,
87
+ role="argument",
88
+ id=html_id ~ "(" ~ argument.name ~ ")",
89
+ class="doc doc-heading doc-heading-argument",
90
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-argument"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + argument.name,
91
+ ) %}
92
+ <b><code>{{ argument.name }}</code></b>
93
+ {% endfilter %}
94
+ {% else %}
95
+ <b><code>{{ argument.name }}</code></b>
96
+ {% endif %}
97
+ {% if argument.annotation %}
98
+ {% with expression = argument.annotation, backlink_type = "used-by" %}
99
+ (<code>{% include "expression.html.jinja" with context %}</code>)
100
+ {% endwith %}
101
+ {% endif %}
102
+
103
+ <div class="doc-md-description">
104
+ {{ argument.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
105
+ </div>
106
+ </li>
107
+ {% endfor %}
108
+ </ul>
109
+ {% endblock list_style %}
110
+ {% elif config.docstring_section_style == "spacy" %}
111
+ {% block spacy_style scoped %}
112
+ {#- Block for the `spacy` section style. -#}
113
+ <table>
114
+ <thead>
115
+ <tr>
116
+ <th><span class="doc-section-title">{{ (section.title or lang.t("NAME-VALUE ARGUMENT")).rstrip(":").upper() }}</span></th>
117
+ <th><span>{{ lang.t("DESCRIPTION") }}</span></th>
118
+ </tr>
119
+ </thead>
120
+ <tbody>
121
+ {% for argument in section.value %}
122
+ <tr class="doc-section-item">
123
+ <td>
124
+ {% if config.argument_headings %}
125
+ {% filter heading(
126
+ heading_level + 1,
127
+ role="argument",
128
+ id=html_id ~ "(" ~ argument.name ~ ")",
129
+ class="doc doc-heading doc-heading-argument",
130
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-argument"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + argument.name,
131
+ ) %}
132
+ <code>{{ argument.name }}</code>
133
+ {% endfilter %}
134
+ {% else %}
135
+ <code>{{ argument.name }}</code>
136
+ {% endif %}
137
+ </td>
138
+ <td class="doc-argument-details">
139
+ <div class="doc-md-description">
140
+ {{ argument.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
141
+ </div>
142
+ <p>
143
+ {% if argument.annotation %}
144
+ <span class="doc-argument-annotation">
145
+ <b>{{ lang.t("TYPE:") }}</b>
146
+ {% with expression = argument.annotation, backlink_type = "used-by" %}
147
+ <code>{% include "expression.html.jinja" with context %}</code>
148
+ {% endwith %}
149
+ </span>
150
+ {% endif %}
151
+ {% if argument.default %}
152
+ <span class="doc-argument-default">
153
+ <b>{{ lang.t("DEFAULT:") }}</b>
154
+ {% with expression = argument.default, backlink_type = "used-by" %}
155
+ <code>{% include "expression.html.jinja" with context %}</code>
156
+ {% endwith %}
157
+ </span>
158
+ {% endif %}
159
+ </p>
160
+ </td>
161
+ </tr>
162
+ {% endfor %}
163
+ </tbody>
164
+ </table>
165
+ {% endblock spacy_style %}
166
+ {% endif %}
@@ -9,19 +9,18 @@ Context:
9
9
 
10
10
  {% block logs scoped %}
11
11
  {#- Logging block.
12
-
12
+
13
13
  This block can be used to log debug messages, deprecation messages, warnings, etc.
14
14
  -#}
15
15
  {{ log.debug("Rendering namespaces section") }}
16
16
  {% endblock logs %}
17
-
18
- {% import "language"|get_template as lang with context %}
17
+ {% import "language.html.jinja" as lang with context %}
19
18
  {#- Language module providing the `t` translation method. -#}
20
19
 
21
20
  {% if config.docstring_section_style == "table" %}
22
21
  {% block table_style scoped %}
23
22
  {#- Block for the `table` section style. -#}
24
- <p><span class="doc-section-title">{{ section.title or "Namespaces:" }}</span></p>
23
+ <p><span class="doc-section-title">{{ section.title or lang.t("Namespaces:") }}</span></p>
25
24
  <table>
26
25
  <thead>
27
26
  <tr>
@@ -46,7 +45,7 @@ Context:
46
45
  {% elif config.docstring_section_style == "list" %}
47
46
  {% block list_style scoped %}
48
47
  {#- Block for the `list` section style. -#}
49
- <p><span class="doc-section-title">{{ section.title or "Namespaces:" }}</span></p>
48
+ <p><span class="doc-section-title">{{ section.title or lang.t("Namespaces:") }}</span></p>
50
49
  <ul>
51
50
  {% for module in section.value %}
52
51
  <li class="doc-section-item field-body">
@@ -65,7 +64,7 @@ Context:
65
64
  <table>
66
65
  <thead>
67
66
  <tr>
68
- <th><span class="doc-section-title">{{ (section.title or "NAMESPACE:").rstrip(":").upper() }}</span></th>
67
+ <th><span class="doc-section-title">{{ (section.title or lang.t("NAMESPACE:")).rstrip(":").upper() }}</span></th>
69
68
  <th><span>{{ lang.t("DESCRIPTION") }}</span></th>
70
69
  </tr>
71
70
  </thead>
@@ -0,0 +1,152 @@
1
+ {#- Template for "Output arguments" sections in docstrings.
2
+
3
+ This template renders a list of documented output arguments 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 output arguments section") }}
16
+ {% endblock logs %}
17
+ {% import "language.html.jinja" as lang with context %}
18
+ {#- Language module providing the `t` translation method. -#}
19
+
20
+ {% if config.docstring_section_style == "table" %}
21
+ {% block table_style scoped %}
22
+ {#- Block for the `table` section style. -#}
23
+ <p><span class="doc-section-title">{{ section.title or lang.t("Output arguments:") }}</span></p>
24
+ <table>
25
+ <thead>
26
+ <tr>
27
+ <th>{{ lang.t("Name") }}</th>
28
+ <th>{{ lang.t("Type") }}</th>
29
+ <th>{{ lang.t("Description") }}</th>
30
+ </tr>
31
+ </thead>
32
+ <tbody>
33
+ {% for argument in section.value %}
34
+ <tr class="doc-section-item">
35
+ <td>
36
+ {% if config.argument_headings %}
37
+ {% filter heading(
38
+ heading_level + 1,
39
+ role="argument",
40
+ id=html_id ~ "(" ~ argument.name ~ ")",
41
+ class="doc doc-heading doc-heading-argument",
42
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-argument"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + argument.name,
43
+ ) %}
44
+ <code>{{ argument.name }}</code>
45
+ {% endfilter %}
46
+ {% else %}
47
+ <code>{{ argument.name }}</code>
48
+ {% endif %}
49
+ </td>
50
+ <td>
51
+ {% if argument.annotation %}
52
+ {% with expression = argument.annotation, backlink_type = "returned-by" %}
53
+ <code>{% include "expression.html.jinja" with context %}</code>
54
+ {% endwith %}
55
+ {% endif %}
56
+ </td>
57
+ <td>
58
+ <div class="doc-md-description">
59
+ {{ argument.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
60
+ </div>
61
+ </td>
62
+ </tr>
63
+ {% endfor %}
64
+ </tbody>
65
+ </table>
66
+ {% endblock table_style %}
67
+ {% elif config.docstring_section_style == "list" %}
68
+ {% block list_style scoped %}
69
+ {#- Block for the `list` section style. -#}
70
+ <p><span class="doc-section-title">{{ section.title or lang.t("Output arguments:") }}</span></p>
71
+ <ul>
72
+ {% for argument in section.value %}
73
+ <li class="doc-section-item field-body">
74
+ {% if config.argument_headings %}
75
+ {% filter heading(
76
+ heading_level + 1,
77
+ role="argument",
78
+ id=html_id ~ "(" ~ argument.name ~ ")",
79
+ class="doc doc-heading doc-heading-argument",
80
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-argument"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + argument.name,
81
+ ) %}
82
+ <b><code>{{ argument.name }}</code></b>
83
+ {% endfilter %}
84
+ {% else %}
85
+ <b><code>{{ argument.name }}</code></b>
86
+ {% endif %}
87
+ {% if argument.annotation %}
88
+ {% with expression = argument.annotation, backlink_type = "returned-by" %}
89
+ {% if argument.name %} ({% endif %}
90
+ <code>{% include "expression.html.jinja" with context %}</code>
91
+ {% if argument.name %}){% endif %}
92
+ {% endwith %}
93
+ {% endif %}
94
+
95
+ <div class="doc-md-description">
96
+ {{ argument.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
97
+ </div>
98
+ </li>
99
+ {% endfor %}
100
+ </ul>
101
+ {% endblock list_style %}
102
+ {% elif config.docstring_section_style == "spacy" %}
103
+ {% block spacy_style scoped %}
104
+ {#- Block for the `spacy` section style. -#}
105
+ <table>
106
+ <thead>
107
+ <tr>
108
+ <th><span class="doc-section-title">{{ (section.title or lang.t("OUTPUT ARGUMENT")).rstrip(":").upper() }}</span></th>
109
+ <th><span>{{ lang.t("DESCRIPTION").upper() }}</span></th>
110
+ </tr>
111
+ </thead>
112
+ <tbody>
113
+ {% for argument in section.value %}
114
+ <tr class="doc-section-item">
115
+ <td>
116
+ {% if config.argument_headings %}
117
+ {% filter heading(
118
+ heading_level + 1,
119
+ role="argument",
120
+ id=html_id ~ "(" ~ argument.name ~ ")",
121
+ class="doc doc-heading doc-heading-argument",
122
+ toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-argument"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + argument.name,
123
+ ) %}
124
+ <code>{{ argument.name }}</code>
125
+ {% endfilter %}
126
+ {% else %}
127
+ <code>{{ argument.name }}</code>
128
+ {% endif %}
129
+ </td>
130
+ <td class="doc-argument-details">
131
+ <div class="doc-md-description">
132
+ {{ argument.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
133
+ </div>
134
+ {% if argument.name and argument.annotation %}
135
+ <p>
136
+ {% if argument.annotation %}
137
+ <span class="doc-argument-annotation">
138
+ <b>{{ lang.t("TYPE:") }}</b>
139
+ {% with expression = argument.annotation, backlink_type = "used-by" %}
140
+ <code>{% include "expression.html.jinja" with context %}</code>
141
+ {% endwith %}
142
+ </span>
143
+ {% endif %}
144
+ </p>
145
+ {% endif %}
146
+ </td>
147
+ </tr>
148
+ {% endfor %}
149
+ </tbody>
150
+ </table>
151
+ {% endblock spacy_style %}
152
+ {% endif %}