Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 926c3df

Browse files
committed
Added comment to autoapi template.
1 parent de93360 commit 926c3df

2 files changed

Lines changed: 46 additions & 231 deletions

File tree

doc/_templates/autoapi/module.rst

Lines changed: 46 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
{{ node.name }}
2-
=={{ '=' * node.name|length }}==
1+
.. # Template modified by Patrick Lehmann
2+
* removed automodule on top, because private members are activated for autodoc (no doubled documentation).
3+
* Made sections like 'submodules' bold text, but no headlines to reduce number of ToC levels.
34
4-
.. automodule:: {{ node.name }}
5+
=={{ '=' * node.name|length }}==
6+
``{{ node.name }}``
7+
=={{ '=' * node.name|length }}==
58

69
{##}
710
{%- block modules -%}
811
{%- if subnodes %}
912

10-
.. #-----------------------------------
11-
{##}
1213
**Submodules**
1314

15+
1416
.. toctree::
1517
{% for item in subnodes %}
1618
{{ item.name }}
@@ -21,123 +23,85 @@
2123
{##}
2224
.. currentmodule:: {{ node.name }}
2325
{##}
26+
{%- block functions -%}
27+
{%- if node.functions %}
2428

25-
.. #-----------------------------------
26-
{##}
27-
{%- if node.variables %}
28-
**Variables**
29-
{##}
30-
{% for item, obj in node.variables.items() -%}
31-
- :py:data:`{{ item }}`
32-
{% endfor -%}
33-
{%- endif -%}
34-
29+
**Functions**
3530

36-
{%- if node.exceptions %}
37-
{##}
38-
**Exceptions**
39-
{##}
40-
{% for item, obj in node.exceptions.items() -%}
41-
- :py:exc:`{{ item }}`:
31+
{% for item, obj in node.functions.items() -%}
32+
- :py:func:`{{ item }}`:
4233
{{ obj|summary }}
4334

4435
{% endfor -%}
45-
{%- endif -%}
4636

37+
{% for item in node.functions %}
38+
.. autofunction:: {{ item }}
39+
{##}
40+
{%- endfor -%}
41+
{%- endif -%}
42+
{%- endblock -%}
4743

44+
{%- block classes -%}
4845
{%- if node.classes %}
49-
{##}
46+
5047
**Classes**
51-
{##}
48+
5249
{% for item, obj in node.classes.items() -%}
5350
- :py:class:`{{ item }}`:
5451
{{ obj|summary }}
5552

5653
{% endfor -%}
57-
{%- endif -%}
5854

55+
{% for item in node.classes %}
56+
.. autoclass:: {{ item }}
57+
:members:
5958

60-
{%- if node.functions %}
61-
{##}
62-
**Functions**
63-
{##}
64-
{% for item, obj in node.functions.items() -%}
65-
- :py:func:`{{ item }}`:
66-
{{ obj|summary }}
67-
68-
{% endfor -%}
69-
{%- endif -%}
70-
71-
72-
{%- block variables -%}
73-
{%- if node.variables %}
74-
{% for item, obj in node.variables.items() %}
75-
.. autodata:: {{ item }}
76-
:annotation:
77-
78-
.. code-block:: guess
79-
80-
{{ obj|pprint|indent(6) }}
59+
.. rubric:: Inheritance
60+
.. inheritance-diagram:: {{ item }}
61+
:parts: 1
8162
{##}
8263
{%- endfor -%}
8364
{%- endif -%}
8465
{%- endblock -%}
8566

86-
8767
{%- block exceptions -%}
8868
{%- if node.exceptions %}
8969

90-
.. #-----------------------------------
91-
92-
{% for item in node.exceptions %}
93-
.. autoexception:: {{ item }}
94-
:members:
95-
:private-members:
96-
:inherited-members:
97-
:undoc-members:
98-
{##}
99-
.. rubric:: Inheritance
100-
.. inheritance-diagram:: {{ item }}
101-
{##}
102-
.. rubric:: Members
103-
{##}
104-
{%- endfor -%}
105-
{%- endif -%}
106-
{%- endblock -%}
70+
**Exceptions**
10771

72+
{% for item, obj in node.exceptions.items() -%}
73+
- :py:exc:`{{ item }}`:
74+
{{ obj|summary }}
10875

109-
{%- block classes -%}
110-
{%- if node.classes %}
76+
{% endfor -%}
11177

112-
.. #-----------------------------------
78+
{% for item in node.exceptions %}
79+
.. autoexception:: {{ item }}
11380

114-
{% for item in node.classes %}
115-
.. autoclass:: {{ item }}
116-
:members:
117-
:private-members:
118-
:undoc-members:
119-
:inherited-members:
120-
{##}
12181
.. rubric:: Inheritance
12282
.. inheritance-diagram:: {{ item }}
12383
:parts: 1
124-
{##}
125-
.. rubric:: Members
12684
{##}
12785
{%- endfor -%}
12886
{%- endif -%}
12987
{%- endblock -%}
13088

89+
{%- block variables -%}
90+
{%- if node.variables %}
13191

132-
{%- block functions -%}
133-
{%- if node.functions %}
92+
**Variables**
13493

135-
.. #-----------------------------------
94+
{% for item, obj in node.variables.items() -%}
95+
- :py:data:`{{ item }}`
96+
{% endfor -%}
13697

137-
**Functions**
98+
{% for item, obj in node.variables.items() %}
99+
.. autodata:: {{ item }}
100+
:annotation:
138101

139-
{% for item in node.functions %}
140-
.. autofunction:: {{ item }}
102+
.. code-block:: text
103+
104+
{{ obj|pprint|indent(6) }}
141105
{##}
142106
{%- endfor -%}
143107
{%- endif -%}

doc/_templates/autoapi/script.rst

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)