Skip to content

Commit 57405cb

Browse files
committed
fix: Add templates for accessors
Issue-13: #13
1 parent 3324c2a commit 57405cb

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{{ log.debug("Rendering " + accessor.path) }}
2+
3+
<div class="doc doc-object doc-accessor">
4+
{% with obj = accessor, html_id = accessor.path %}
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 %}
15+
16+
{% set accessor_name = accessor.path if show_full_path else accessor.name %}
17+
18+
{% if not root or config.show_root_heading %}
19+
{% filter heading(
20+
heading_level,
21+
role="accessor",
22+
id=html_id,
23+
class="doc doc-heading",
24+
toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-accessor"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + accessor.name,
25+
) %}
26+
27+
{% block heading scoped %}
28+
{% if config.show_symbol_type_heading %}<code class="doc-symbol doc-symbol-heading doc-symbol-accessor"></code>{% endif %}
29+
{% if config.separate_signature %}
30+
<span class="doc doc-object-name doc-accessor-name">{{ accessor_name }}</span>
31+
{% else %}
32+
<code>{{ accessor_name }}</code>
33+
{% endif %}
34+
{% endblock heading %}
35+
36+
{% endfilter %}
37+
38+
{% else %}
39+
{% if config.show_root_toc_entry %}
40+
{% filter heading(heading_level,
41+
role="accessor",
42+
id=html_id,
43+
toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-accessor"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + accessor.name,
44+
hidden=True,
45+
) %}
46+
{% endfilter %}
47+
{% endif %}
48+
{% set heading_level = heading_level - 1 %}
49+
{% endif %}
50+
51+
<div class="doc doc-contents {% if root %}first{% endif %}">
52+
{% block contents scoped %}
53+
{% block docstring scoped %}
54+
{% if accessor.comment %}
55+
{{ accessor.comment.markdown(symbol_map=accessor.symbol_map)|convert_markdown(heading_level, html_id) }}
56+
{% endif %}
57+
{% endblock docstring %}
58+
{% block children scoped %}
59+
{% set root = False %}
60+
{% set heading_level = heading_level + 1 %}
61+
{% include "children.html.jinja" with context %}
62+
{% endblock children %}
63+
{% endblock contents %}
64+
</div>
65+
66+
{% endwith %}
67+
</div>
68+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "_base/accessor.html.jinja" %}

0 commit comments

Comments
 (0)