|
1 | | -{{ fullname }} |
2 | | -{{ underline }} |
3 | | - |
4 | | -.. currentmodule:: {{ module }} |
5 | | - |
6 | | -.. autoclass:: {{ objname }} |
7 | | - |
8 | | - .. |
9 | | - Methods |
| 1 | +{% extends "!autosummary/class.rst" %} |
10 | 2 |
|
11 | 3 | {% block methods %} |
12 | | - |
13 | | - .. rubric:: Methods |
14 | | - |
15 | | - .. |
16 | | - Special methods |
17 | | -
|
18 | | -{% for item in ('__getitem__', '__setitem__', '__len__', '__next__', '__iter__') %} |
19 | | -{% if item in all_methods or item in all_attributes %} |
20 | | - .. automethod:: {{ item }} |
| 4 | +{% if methods %} |
| 5 | + .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. |
| 6 | + .. autosummary:: |
| 7 | + :toctree: |
| 8 | + {% for item in all_methods %} |
| 9 | + {%- if not item.startswith('_') or item in ['__call__'] %} |
| 10 | + {{ name }}.{{ item }} |
| 11 | + {%- endif -%} |
| 12 | + {%- endfor %} |
21 | 13 | {% endif %} |
22 | | -{%- endfor %} |
23 | | - |
24 | | - .. |
25 | | - Ordinary methods |
26 | | -
|
27 | | -{% for item in methods %} |
28 | | -{% if item not in ('__init__',) %} |
29 | | - .. automethod:: {{ item }} |
30 | | -{% endif %} |
31 | | -{%- endfor %} |
32 | | - |
33 | | - .. |
34 | | - Special methods |
| 14 | +{% endblock %} |
35 | 15 |
|
36 | | -{% for item in ('__eq__', '__ne__', '__lt__', '__le__', '__gt__', '__ge__') %} |
37 | | -{% if item in all_methods %} |
38 | | - .. automethod:: {{ item }} |
| 16 | +{% block attributes %} |
| 17 | +{% if attributes %} |
| 18 | + .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. |
| 19 | + .. autosummary:: |
| 20 | + :toctree: |
| 21 | + {% for item in all_attributes %} |
| 22 | + {%- if not item.startswith('_') %} |
| 23 | + {{ name }}.{{ item }} |
| 24 | + {%- endif -%} |
| 25 | + {%- endfor %} |
39 | 26 | {% endif %} |
40 | | -{%- endfor %} |
41 | 27 | {% endblock %} |
42 | | - |
43 | | - .. |
44 | | - Attributes |
45 | | -
|
46 | | -{% block attributes %} {% if attributes %} |
47 | | - |
48 | | - .. rubric:: Attributes |
49 | | - |
50 | | -{% for item in attributes %} |
51 | | - .. autoattribute:: {{ item }} |
52 | | -{%- endfor %} |
53 | | -{% endif %} {% endblock %} |
0 commit comments