1+ {# import "autodoc.md.jinja" as Autodoc #}
2+ {# def ds, level=2 #}
3+
4+ {% - if ds .symbol or ds .name %}
5+ {{ "#" * level }} `{{ ds.symbol }}`{ .autodoc-symbol .autodoc-symbol-{{ ds.symbol }} } `{{ ds.name }}`{ .autodoc-name .autodoc-name-{{ ds.symbol }} }
6+ {% - if ds .label %} `{{ ds.label }}`{ .autodoc-label .autodoc-label-{{ ds.label }} }{% endif %}
7+ {% endif -%}
8+
9+ {% - if ds .short_description %}
10+ :::: div autodoc-short-description
11+ {{ ds.short_description | safe }}
12+ ::::
13+ {% endif -%}
14+
15+ {% - if ds .signature %}
16+ ````python
17+ {{ ds.signature | safe }}
18+ ````
19+ {% endif -%}
20+
21+ {% - if ds .bases -%}
22+ :::: div autodoc-bases
23+ Bases: {% for base in ds .bases %} `{{ base }}`{% if not loop .last %} , {% endif %}
24+ {% - endfor %}
25+ ::::
26+ {% endif -%}
27+
28+ {% - if ds .params %}
29+ :::: div autodoc-table autodoc-arguments
30+
31+ Argument | Description
32+ -------- | --------
33+ {% - for param in ds .params %}
34+ `{{ param.name }}` | {{ param.description | replace('\n', '<br/>') | safe }}
35+ {% - endfor %}
36+
37+ ::::
38+ {% endif -%}
39+
40+ {% - if ds .long_description %}
41+ :::: div autodoc-long-description
42+ {{ ds.long_description | safe }}
43+ ::::
44+ {% endif %}
45+ {% - if ds .examples %}
46+ :::: div autodoc-examples
47+ **Example:**
48+
49+ {% for ex in ds .examples -%}
50+ ::: div
51+ {% - if ex .description %} {{ ex.description | safe }}
52+ {% endif -%}
53+ {% - if ex .snippet %}
54+ ````python
55+ {{ ex.snippet | safe }}
56+ ````
57+ {% endif %}
58+ :::
59+ {% endfor %}
60+ ::::
61+ {% endif -%}
62+
63+ {% - if ds .returns or ds .many_returns %}
64+ :::: div autodoc-returns
65+ **Returns:**
66+ {% - if ds .returns %}
67+ {{ ds.returns.description | safe }}
68+ {% - elif ds .many_returns -%}
69+ {% - for return in ds .many_returns %}
70+ - **{{ return.return_name }}**: {{ return.description | safe }}
71+ {% - endfor %}
72+ {% endif %}
73+ ::::
74+ {% endif -%}
75+
76+ {% - if ds .raises %}
77+ :::: div autodoc-raises
78+ **Raises:**
79+ {% for raises in ds .raises -%}
80+ - {{ raises.description | safe }}
81+ {% endfor %}
82+ ::::
83+ {% endif -%}
84+
85+ {% - if ds .attrs %}
86+ ::::: div autodoc-attrs
87+ {% for attr in ds .attrs %}
88+ <Autodoc ds ={{ attr }} level ={{ level + 1 }} />
89+ {% endfor %}
90+ :::::
91+ {% endif -%}
92+
93+ {% - if ds .properties %}
94+ ::::: div autodoc-properties
95+ {% for attr in ds .properties %}
96+ <Autodoc ds ={{ attr }} level ={{ level + 1 }} />
97+ {% - endfor %}
98+ :::::
99+ {% endif -%}
100+
101+ {% - if ds .methods %}
102+ ::::: div autodoc-methods
103+ {% for method in ds .methods %}
104+ <Autodoc ds ={{ method }} level ={{ level + 1 }} />
105+ {% - endfor %}
106+ :::::
107+ {% endif -%}
0 commit comments