Skip to content

Commit 915df40

Browse files
committed
Add custom autosummary module template to ignore test files
1 parent 58f8edf commit 915df40

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. automodule:: {{ fullname }}
4+
5+
{% block attributes %}
6+
{%- if attributes %}
7+
.. rubric:: {{ _('Module Attributes') }}
8+
9+
.. autosummary::
10+
{% for item in attributes %}
11+
{{ item }}
12+
{%- endfor %}
13+
{% endif %}
14+
{%- endblock %}
15+
16+
{%- block functions %}
17+
{%- if functions %}
18+
.. rubric:: {{ _('Functions') }}
19+
20+
.. autosummary::
21+
{% for item in functions %}
22+
{{ item }}
23+
{%- endfor %}
24+
{% endif %}
25+
{%- endblock %}
26+
27+
{%- block classes %}
28+
{%- if classes %}
29+
.. rubric:: {{ _('Classes') }}
30+
31+
.. autosummary::
32+
{% for item in classes %}
33+
{{ item }}
34+
{%- endfor %}
35+
{% endif %}
36+
{%- endblock %}
37+
38+
{%- block exceptions %}
39+
{%- if exceptions %}
40+
.. rubric:: {{ _('Exceptions') }}
41+
42+
.. autosummary::
43+
{% for item in exceptions %}
44+
{{ item }}
45+
{%- endfor %}
46+
{% endif %}
47+
{%- endblock %}
48+
49+
{%- block modules %}
50+
{%- if modules %}
51+
.. rubric:: Modules
52+
53+
.. autosummary::
54+
:toctree:
55+
:template: custom-module-template.rst
56+
:recursive:
57+
{% for item in modules %}
58+
{% if not 'tests' in item %}
59+
{{ item }}
60+
{%- endif %}
61+
{%- endfor %}
62+
{% endif %}
63+
{%- endblock %}

docs/reference.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ API reference for all modules in the Spyder application.
55

66
.. autosummary::
77
:toctree: _autosummary
8+
:template: custom-module-template.rst
89
:recursive:
910

1011
spyder.api

0 commit comments

Comments
 (0)