-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Methods are documented on class pages #10455
Conversation
One or more of the the following people are requested to review this:
|
Preview the docs at https://dev.azure.com/qiskit-ci/b6f351e4-6a09-4bf6-b029-4b7806a7bde7/_apis/build/builds/48160/artifacts?artifactName=html_docs&api-version=7.0&%24format=zip. Note that the design is improved with the upcoming Furo theme. This PR unblocks it. |
Pull Request Test Coverage Report for Build 5612762310
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty inline with the minimal change I was expecting.
Is it worth completely removing the loops from the class
summary templates, and switching the :no-members:
option to :members:
, so autodoc
manages it all itself? I've found raw autodoc
to be quite sane, and for it to generally improve over time as well.
Is it possible to add links on the right sidebar for each section (Attributes, Methods, etc.)? For example, |
For Changing the |
I don't think so because we want the -- @coruscating that's a Pytorch problem. The example docs use the exact same templates at this PR: This PR and the followup to remove functions both unblock us switching to Furo in the metapackage - we'll switch over right away after. Further, this change doesn't go "live" until we do the final 0.25 release because the metapackage builds off of releases, not |
@Eric-Arellano That's good to see the new theme automatically adds links to individual attributes and methods, though I'd prefer to have actual headings like "Methods" and "Attributes" that they're listed under, otherwise it'll be a very long unsorted list on some pages. @jakelishman We tried changing |
Helena: the reason it might be different for you compared to us is that you guys were (or at least appeared to be) modifying a docstring that was embedded into more free-form other pages, where you didn't have control on what other section-heading constructs were used. In the current setup, |
Eric: in my vein of "raw |
Good find @jakelishman. But looks like we don't want to use it. With this template: {{ objname | escape | underline }}
.. currentmodule:: {{ module }}
.. autoclass:: {{ objname }}
:members:
:show-inheritance: That means we won't have rubrics/headers and the members will appear as subheaders rather than top-level entries: --
I was able to get headers working rather than rubrics: {% block attributes_summary %}
{% if attributes %}
Attributes
----------
{% for item in attributes %}
.. autoattribute:: {{ item }}
{%- endfor %}
{% endif %}
{% endblock -%} But, it doesn't impact the right sidebar at all. |
Ah, that's a shame. I wonder if |
As long as we, of course, don't block this PR on it, sure! Upstreaming config is always nice. |
Yeah, totally fine by me - I don't even think we're using Sphinx 7 yet. |
I'd have to look into why changing the templates to insert a heading doesn't impact the sidebar, but whether or not the documented objects themselves get inserted into the toctree is controlled by the |
Yeah, and we're using the default of True already. -- To clarify, is anything blocking this PR from approval? (Other than time / trying to get out rc1, of course) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not from my side - I'd forgotten I hadn't done it.
I'm taking this out the merge queue because it'd use time that we need for the rc1 release right now. We can add it after that. |
(cherry picked from commit e55389f)
### 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 <14852634+Eric-Arellano@users.noreply.github.com>
### 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 <14852634+Eric-Arellano@users.noreply.github.com>
### 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 <14852634+Eric-Arellano@users.noreply.github.com>
### 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 <14852634+Eric-Arellano@users.noreply.github.com>
### 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 qiskit-community#1231. See Qiskit/qiskit#10455 for more information. --------- Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Currently, methods have their own HTML page. This PR changes them to live on the class page.
Motivations:
A follow-up will move functions to their module page, rather than dedicated pages.
No redirects
We decided it's not worth adding redirects for method pages. Sphinx will already properly update all cross-references to the right place, and we don't expect there to be many external links to method pages.