-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We weren't showing class members (attributes & methods) for inlined classes. This is fixed by setting `"inherited-members": None` in `autodoc_default_options`. Notably, we now show inherited members for classes like `instructions.Move`. I recommend this because users want to know every function/attribute defined on the object, and they don't really care about the origin of that functionality. Qiskit SDK takes this approach, which is useful with e.g. the circuit library. With this change, some of the classes end up being much larger. So, we un-inline them and move them back to being their own pages in `stubs/`. This means we remove their client redirects. This PR also makes some other enhancements: * Adds `tox -e docs-clean` * Displays type hints in the `parameters` section, rather than inline to the signature. This matches the style of the other API projects
- Loading branch information
1 parent
6f9c2ed
commit 0ecc244
Showing
8 changed files
with
71 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{# | ||
We show all the class's methods and attributes on the same page. By default, we document | ||
all methods, including those defined by parent classes. | ||
-#} | ||
|
||
{{ objname | escape | underline }} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. autoclass:: {{ objname }} | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: | ||
:show-inheritance: | ||
|
||
{% block attributes_summary %} | ||
{% if attributes %} | ||
.. rubric:: Attributes | ||
{% for item in attributes %} | ||
.. autoattribute:: {{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock -%} | ||
|
||
{% block methods_summary %} | ||
{% set wanted_methods = (methods | reject('==', '__init__') | list) %} | ||
{% if wanted_methods %} | ||
.. rubric:: Methods | ||
{% for item in wanted_methods %} | ||
.. automethod:: {{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} |
41 changes: 0 additions & 41 deletions
41
docs/_templates/autosummary/class_no_inherited_members.rst
This file was deleted.
Oops, something went wrong.
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
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