forked from mkdocstrings/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattributes.html
More file actions
90 lines (88 loc) · 2.76 KB
/
attributes.html
File metadata and controls
90 lines (88 loc) · 2.76 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
{{ log.debug("Rendering attributes section") }}
{% import "language.html" as lang with context %}
{% if config.docstring_section_style == "table" %}
{% block table_style %}
<p><strong>{{ section.title or lang.t("Attributes:") }}</strong></p>
<table>
<thead>
<tr>
<th>{{ lang.t("Name") }}</th>
<th>{{ lang.t("Type") }}</th>
<th>{{ lang.t("Description") }}</th>
</tr>
</thead>
<tbody>
{% for attribute in section.value %}
<tr>
<td><code>{{ attribute.name }}</code></td>
<td>
{% if attribute.annotation %}
{% with expression = attribute.annotation %}
<code>{% include "expression.html" with context %}</code>
{% endwith %}
{% endif %}
</td>
<td>
<div class="doc-md-description">
{{ attribute.description|convert_markdown(heading_level, html_id) }}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
<p>{{ section.title or lang.t("Attributes:") }}</p>
<ul>
{% for attribute in section.value %}
<li class="field-body">
<b>{{ attribute.name }}</b>
{% if attribute.annotation %}
{% with expression = attribute.annotation %}
(<code>{% include "expression.html" with context %}</code>)
{% endwith %}
{% endif %}
–
<div class="doc-md-description">
{{ attribute.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("ATTRIBUTE")).rstrip(":").upper() }}</b></th>
<th><b>{{ lang.t("DESCRIPTION") }}</b></th>
</tr>
</thead>
<tbody>
{% for attribute in section.value %}
<tr>
<td><code>{{ attribute.name }}</code></td>
<td class="doc-attribute-details">
<div class="doc-md-description">
{{ attribute.description|convert_markdown(heading_level, html_id) }}
</div>
<p>
{% if attribute.annotation %}
<span class="doc-attribute-annotation">
<b>TYPE:</b>
{% with expression = attribute.annotation %}
<code>{% include "expression.html" with context %}</code>
{% endwith %}
</span>
{% endif %}
</p>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock spacy_style %}
{% endif %}