Skip to content

Commit a74dc33

Browse files
tswasttseaver
authored andcommitted
Only generate one documentation file per class. (#6272)
Speeds up BigQuery documentation generation by only generating one file per class instead of one file per method and attribute.
1 parent 05dea1b commit a74dc33

1 file changed

Lines changed: 28 additions & 27 deletions

File tree

  • third_party/sphinx/sphinx/ext/autosummary/templates/autosummary

third_party/sphinx/sphinx/ext/autosummary/templates/autosummary/class.rst

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,35 @@
22

33
.. currentmodule:: {{ module }}
44

5-
.. autoclass:: {{ objname }}
5+
{% block methods %}
6+
{% if methods %}
7+
.. rubric:: Methods
68

7-
{% block methods %}
8-
.. automethod:: __init__
9-
10-
{% if methods %}
11-
.. rubric:: Methods
12-
13-
{# Customized from original by adding toctree. This generates docs for the
14-
listed functions. #}
15-
.. autosummary::
16-
:toctree: .
17-
{% for item in methods %}
18-
{% if item != '__init__' %}
19-
~{{ name }}.{{ item }}
20-
{% endif %}
21-
{%- endfor %}
9+
.. autosummary::
10+
{% for item in methods %}
11+
{% if item != '__init__' %}
12+
~{{ name }}.{{ item }}
2213
{% endif %}
23-
{% endblock %}
14+
{%- endfor %}
15+
{% endif %}
16+
{% endblock %}
2417

25-
{% block attributes %}
26-
{% if attributes %}
27-
.. rubric:: Attributes
18+
{% block attributes %}
19+
{% if attributes %}
20+
.. rubric:: Attributes
2821

29-
.. autosummary::
30-
:toctree: .
31-
{% for item in attributes %}
32-
~{{ name }}.{{ item }}
33-
{%- endfor %}
34-
{% endif %}
35-
{% endblock %}
22+
.. autosummary::
23+
{% for item in attributes %}
24+
~{{ name }}.{{ item }}
25+
{%- endfor %}
26+
{% endif %}
27+
{% endblock %}
28+
29+
.. raw:: html
30+
31+
<p>
32+
<hr>
33+
<p>
34+
35+
.. autoclass:: {{ objname }}
36+
:members:

0 commit comments

Comments
 (0)