Skip to content

Commit 5e967cf

Browse files
committed
Add missing images and templates
1 parent 3870478 commit 5e967cf

File tree

6 files changed

+88
-0
lines changed

6 files changed

+88
-0
lines changed

docs/_assets/api-key.png

51.1 KB
Loading
134 KB
Loading
227 KB
Loading

docs/_templates/autoapi/class.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% if visible_methods or visible_attributes %}
2+
.. rubric:: Overview
3+
4+
{% set summary_methods = visible_methods|rejectattr("properties", "contains", "property")|list %}
5+
{% set summary_attributes = visible_attributes + visible_methods|selectattr("properties", "contains", "property")|list %}
6+
7+
{% if summary_attributes %}
8+
{{ macros.auto_summary(summary_attributes, title="Attributes")|indent(3) }}
9+
{% endif %}
10+
11+
{% if summary_methods %}
12+
{{ macros.auto_summary(summary_methods, title="Methods")|indent(3) }}
13+
{% endif %}
14+
15+
.. rubric:: Members
16+
17+
{% for attribute in visible_attributes %}
18+
{{ attribute.render()|indent(3) }}
19+
{% endfor %}
20+
{% for method in visible_methods %}
21+
{{ method.render()|indent(3) }}
22+
{% endfor %}
23+
{% endif %}
24+

docs/_templates/autoapi/macros.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{% macro _render_item_name(obj, sig=False) -%}
2+
:py:obj:`{{ obj.name }} <{{ obj.id }}>`
3+
{%- if sig -%}
4+
\ (
5+
{%- for arg in obj.obj.args -%}
6+
{%- if arg[0] %}{{ arg[0]|replace('*', '\*') }}{% endif -%}{{ arg[1] -}}
7+
{%- if not loop.last %}, {% endif -%}
8+
{%- endfor -%}
9+
){%- endif -%}
10+
{%- endmacro %}
11+
12+
{% macro _item(obj, sig=False, label='') %}
13+
* - {{ _render_item_name(obj, sig) }}
14+
- {% if label %}:summarylabel:`{{ label }}` {% endif %}{% if obj.summary %}{{ obj.summary }}{% else %}\-{% endif +%}
15+
16+
{% endmacro %}
17+
18+
{% macro auto_summary(objs, title='') -%}
19+
.. list-table:: {{ title }}
20+
21+
:header-rows: 0
22+
:widths: auto
23+
:class: summarytable
24+
25+
{% for obj in objs -%}
26+
{%- set sig = (obj.type in ['method', 'function'] and not 'property' in obj.properties) -%}
27+
28+
{%- if 'property' in obj.properties -%}
29+
{%- set label = 'prop' -%}
30+
{%- elif 'classmethod' in obj.properties -%}
31+
{%- set label = 'class' -%}
32+
{%- elif 'abstractmethod' in obj.properties -%}
33+
{%- set label = 'abc' -%}
34+
{%- elif 'staticmethod' in obj.properties -%}
35+
{%- set label = 'static' -%}
36+
{%- else -%}
37+
{%- set label = '' -%}
38+
{%- endif -%}
39+
40+
{{- _item(obj, sig=sig, label=label) -}}
41+
{%- endfor -%}
42+
43+
{% endmacro %}
44+

docs/_templates/autoapi/module.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% if "show-module-summary" in autoapi_options and (visible_classes or visible_functions) %}
2+
{% block classes scoped %}
3+
{% if visible_classes %}
4+
{{ macros.auto_summary(visible_classes, title="Classes") }}
5+
{% endif %}
6+
{% endblock %}
7+
8+
{% block functions scoped %}
9+
{% if visible_functions %}
10+
{{ macros.auto_summary(visible_functions, title="Functions") }}
11+
{% endif %}
12+
{% endblock %}
13+
14+
{% block attributes scoped %}
15+
{% if visible_attributes %}
16+
{{ macros.auto_summary(visible_attributes, title="Attributes") }}
17+
{% endif %}
18+
{% endblock %}
19+
{% endif %}
20+

0 commit comments

Comments
 (0)