|
1 | 1 | {{ log.debug("Rendering " + attribute.path) }}
|
2 | 2 |
|
3 | 3 | <div class="doc doc-object doc-attribute">
|
4 |
| -{% with obj = attribute, html_id = attribute.path %} |
| 4 | + {% with obj = attribute, html_id = attribute.path %} |
5 | 5 |
|
6 |
| - {% if root %} |
7 |
| - {% set show_full_path = config.show_root_full_path %} |
8 |
| - {% set root_members = True %} |
9 |
| - {% elif root_members %} |
10 |
| - {% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %} |
11 |
| - {% set root_members = False %} |
12 |
| - {% else %} |
13 |
| - {% set show_full_path = config.show_object_full_path %} |
14 |
| - {% endif %} |
| 6 | + {% if root %} |
| 7 | + {% set show_full_path = config.show_root_full_path %} |
| 8 | + {% set root_members = True %} |
| 9 | + {% elif root_members %} |
| 10 | + {% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %} |
| 11 | + {% set root_members = False %} |
| 12 | + {% else %} |
| 13 | + {% set show_full_path = config.show_object_full_path %} |
| 14 | + {% endif %} |
| 15 | + |
| 16 | + {% set attribute_name = attribute.path if show_full_path else attribute.name %} |
| 17 | + |
| 18 | + {% if not root or config.show_root_heading %} |
| 19 | + {% filter heading( |
| 20 | + heading_level, |
| 21 | + role="data" if attribute.parent.kind.value == "module" else "attr", |
| 22 | + id=html_id, |
| 23 | + class="doc doc-heading", |
| 24 | + toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-attribute"></code> '|safe if config.show_symbol_type_toc else '') + attribute.name, |
| 25 | + ) %} |
15 | 26 |
|
16 |
| - {% set attribute_name = attribute.path if show_full_path else attribute.name %} |
| 27 | + {% block heading scoped %} |
| 28 | + {% if config.show_symbol_type_heading %}<code class="doc-symbol doc-symbol-heading doc-symbol-attribute"></code>{% endif %} |
| 29 | + {% if config.separate_signature %} |
| 30 | + <span class="doc doc-object-name doc-attribute-name">{{ attribute_name }}</span> |
| 31 | + {% else %} |
| 32 | + {%+ filter highlight(language="python", inline=True) %} |
| 33 | + {{ attribute_name }}{% if attribute.annotation %}: {{ attribute.annotation }}{% endif %} |
| 34 | + {% if attribute.value %} = {{ attribute.value }}{% endif %} |
| 35 | + {% endfilter %} |
| 36 | + {% endif %} |
| 37 | + {% endblock heading %} |
17 | 38 |
|
18 |
| - {% if not root or config.show_root_heading %} |
19 |
| - {% filter heading( |
20 |
| - heading_level, |
21 |
| - role="data" if attribute.parent.kind.value == "module" else "attr", |
22 |
| - id=html_id, |
23 |
| - class="doc doc-heading", |
24 |
| - toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-attribute"></code> '|safe if config.show_symbol_type_toc else '') + attribute.name, |
25 |
| - ) %} |
| 39 | + {% block labels scoped %} |
| 40 | + {% with labels = attribute.labels %} |
| 41 | + {% include "labels.html" with context %} |
| 42 | + {% endwith %} |
| 43 | + {% endblock labels %} |
| 44 | + |
| 45 | + {% endfilter %} |
26 | 46 |
|
27 |
| - {% block heading scoped %} |
28 |
| - {% if config.show_symbol_type_heading %}<code class="doc-symbol doc-symbol-heading doc-symbol-attribute"></code>{% endif %} |
| 47 | + {% block signature scoped %} |
29 | 48 | {% if config.separate_signature %}
|
30 |
| - <span class="doc doc-object-name doc-attribute-name">{{ attribute_name }}</span> |
31 |
| - {% else %} |
32 |
| - {%+ filter highlight(language="python", inline=True) %} |
33 |
| - {{ attribute_name }}{% if attribute.annotation %}: {{ attribute.annotation }}{% endif %} |
34 |
| - {% if attribute.value %} = {{ attribute.value }}{% endif %} |
| 49 | + {% filter format_attribute(attribute, config.line_length, crossrefs=config.signature_crossrefs) %} |
| 50 | + {{ attribute.name }} |
35 | 51 | {% endfilter %}
|
36 | 52 | {% endif %}
|
37 |
| - {% endblock heading %} |
| 53 | + {% endblock signature %} |
38 | 54 |
|
39 |
| - {% block labels scoped %} |
40 |
| - {% with labels = attribute.labels %} |
41 |
| - {% include "labels.html" with context %} |
42 |
| - {% endwith %} |
43 |
| - {% endblock labels %} |
| 55 | + {% else %} |
44 | 56 |
|
45 |
| - {% endfilter %} |
46 |
| - |
47 |
| - {% block signature scoped %} |
48 |
| - {% if config.separate_signature %} |
49 |
| - {% filter format_attribute(attribute, config.line_length, crossrefs=config.signature_crossrefs) %} |
50 |
| - {{ attribute.name }} |
| 57 | + {% if config.show_root_toc_entry %} |
| 58 | + {% filter heading(heading_level, |
| 59 | + role="data" if attribute.parent.kind.value == "module" else "attr", |
| 60 | + id=html_id, |
| 61 | + toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-attribute"></code> '|safe if config.show_symbol_type_toc else '') + attribute.name, |
| 62 | + hidden=True, |
| 63 | + ) %} |
51 | 64 | {% endfilter %}
|
52 | 65 | {% endif %}
|
53 |
| - {% endblock signature %} |
54 |
| - |
55 |
| - {% else %} |
56 |
| - |
57 |
| - {% if config.show_root_toc_entry %} |
58 |
| - {% filter heading(heading_level, |
59 |
| - role="data" if attribute.parent.kind.value == "module" else "attr", |
60 |
| - id=html_id, |
61 |
| - toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-attribute"></code> '|safe if config.show_symbol_type_toc else '') + attribute.name, |
62 |
| - hidden=True, |
63 |
| - ) %} |
64 |
| - {% endfilter %} |
| 66 | + {% set heading_level = heading_level - 1 %} |
65 | 67 | {% endif %}
|
66 |
| - {% set heading_level = heading_level - 1 %} |
67 |
| - {% endif %} |
68 | 68 |
|
69 |
| - <div class="doc doc-contents {% if root %}first{% endif %}"> |
70 |
| - {% block contents scoped %} |
71 |
| - {% block docstring scoped %} |
72 |
| - {% with docstring_sections = attribute.docstring.parsed %} |
73 |
| - {% include "docstring.html" with context %} |
74 |
| - {% endwith %} |
75 |
| - {% endblock docstring %} |
76 |
| - {% endblock contents %} |
77 |
| - </div> |
| 69 | + <div class="doc doc-contents {% if root %}first{% endif %}"> |
| 70 | + {% block contents scoped %} |
| 71 | + {% block docstring scoped %} |
| 72 | + {% with docstring_sections = attribute.docstring.parsed %} |
| 73 | + {% include "docstring.html" with context %} |
| 74 | + {% endwith %} |
| 75 | + {% endblock docstring %} |
| 76 | + {% endblock contents %} |
| 77 | + </div> |
78 | 78 |
|
79 |
| -{% endwith %} |
| 79 | + {% endwith %} |
80 | 80 | </div>
|
0 commit comments