-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move methods into class pages for docs (#1290)
### Summary Moved all the methods and attributes into class pages to speed up the building process of the documentation with the new ecosystem sphinx theme. This PR continues the work done by @Eric-Arellano in #1231. See Qiskit/qiskit#10455 for more information. --------- Co-authored-by: Eric Arellano <[email protected]>
- Loading branch information
1 parent
0666228
commit 825ef6e
Showing
6 changed files
with
84 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
docs/_templates/autosummary/class_no_inherited_members.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{# This is identical to class.rst, except for the filtering of the inherited_members. -#} | ||
|
||
{% if referencefile %} | ||
.. include:: {{ referencefile }} | ||
{% endif %} | ||
|
||
{{ objname }} | ||
{{ underline }} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. autoclass:: {{ objname }} | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: | ||
|
||
{% block attributes_summary %} | ||
|
||
{% set wanted_attributes = [] %} | ||
{% for item in attributes%} | ||
{%- if not item.startswith('_') %} | ||
{% set _ = wanted_attributes.append(item)%} | ||
{%- endif -%} | ||
{%- endfor %} | ||
|
||
{% if wanted_attributes%} | ||
.. rubric:: Attributes | ||
{% for item in wanted_attributes %} | ||
.. autoattribute:: {{ name }}.{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block methods_summary %} | ||
|
||
{% set wanted_methods = [] %} | ||
{% for item in all_methods %} | ||
{%- if item not in inherited_members %} | ||
{%- if not item.startswith('_') or item in ['__call__', '__mul__', '__getitem__', '__len__'] %} | ||
{% set _ = wanted_methods.append(item)%} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor %} | ||
|
||
{% if wanted_methods %} | ||
.. rubric:: Methods | ||
{% for item in wanted_methods %} | ||
.. automethod:: {{ name }}.{{ item }} | ||
{%- endfor %} | ||
|
||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters