forked from mkdocstrings/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparameters.html
More file actions
108 lines (106 loc) · 3.48 KB
/
parameters.html
File metadata and controls
108 lines (106 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{{ log.debug("Rendering parameters section") }}
{% import "language.html" as lang with context %}
{% if config.docstring_section_style == "table" %}
{% block table_style %}
<p><strong>{{ section.title or lang.t("Parameters:") }}</strong></p>
<table>
<thead>
<tr>
<th>{{ lang.t("Name") }}</th>
<th>{{ lang.t("Type") }}</th>
<th>{{ lang.t("Description") }}</th>
<th>{{ lang.t("Default") }}</th>
</tr>
</thead>
<tbody>
{% for parameter in section.value %}
<tr>
<td><code>{{ parameter.name }}</code></td>
<td>
{% if parameter.annotation %}
{% with expression = parameter.annotation %}
<code>{% include "expression.html" with context %}</code>
{% endwith %}
{% endif %}
</td>
<td>
<div class="doc-md-description">
{{ parameter.description|convert_markdown(heading_level, html_id) }}
</div>
</td>
<td>
{% if parameter.default %}
{% with expression = parameter.default %}
<code>{% include "expression.html" with context %}</code>
{% endwith %}
{% else %}
<em>{{ lang.t("required") }}</em>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
<p>{{ section.title or lang.t("Parameters:") }}</p>
<ul>
{% for parameter in section.value %}
<li class="field-body">
<b>{{ parameter.name }}</b>
{% if parameter.annotation %}
{% with expression = parameter.annotation %}
(<code>{% include "expression.html" with context %}</code>)
{% endwith %}
{% endif %}
–
<div class="doc-md-description">
{{ parameter.description|convert_markdown(heading_level, html_id) }}
</div>
</li>
{% endfor %}
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
<table>
<thead>
<tr>
<th><b>{{ (section.title or lang.t("PARAMETER")).rstrip(":").upper() }}</b></th>
<th><b> {{ lang.t("DESCRIPTION") }}</b></th>
</tr>
</thead>
<tbody>
{% for parameter in section.value %}
<tr>
<td><code>{{ parameter.name }}</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
{{ parameter.description|convert_markdown(heading_level, html_id) }}
</div>
<p>
{% if parameter.annotation %}
<span class="doc-param-annotation">
<b>{{ lang.t("TYPE:") }}</b>
{% with expression = parameter.annotation %}
<code>{% include "expression.html" with context %}</code>
{% endwith %}
</span>
{% endif %}
{% if parameter.default %}
<span class="doc-param-default">
<b>{{ lang.t("DEFAULT:") }}</b>
{% with expression = parameter.default %}
<code>{% include "expression.html" with context %}</code>
{% endwith %}
</span>
{% endif %}
</p>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock spacy_style %}
{% endif %}