Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
gh-123452: Improved ToC navigation within documentation sections#123453
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
9c85b30c1b2e99a24f20acb1f061d16545e0df7ac80ad85a4573bfa1File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3,6 +3,7 @@ | ||
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| whatsnew/index.rst | ||
| tutorial/index.rst | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| {# | ||
| Customization of Sphinx's basic/localtoc.html | ||
| - When present, display links to the parent pages within sections, | ||
| rather than link to the global contents | ||
| - When parents are absent, display a link to the document root using the docstitle | ||
| #} | ||
| <div> | ||
| <div> | ||
| {%- if parents %} | ||
| {%- for parent in parents[-4:] %} | ||
| <h{{ loop.index0 + 3 }}> | ||
Comment on lines
+8
to
+12
| ||
| <a href="{{ parent.link|e }}" | ||
| title="{{ parent.title|striptags }}"> | ||
| {{ parent.title }} | ||
| </a> | ||
| </h{{ loop.index0 + 3 }}> | ||
| {%- endfor %} | ||
| {%- else %} | ||
| <h3> | ||
| <a href="{{ pathto(root_doc)|e }}" | ||
| title="{{ docstitle|striptags }}"> | ||
| {{ docstitle|e }} | ||
| </a> | ||
| </h3> | ||
| {%- endif %} | ||
| </div> | ||
| {{ toc }} | ||
| </div> | ||
Uh oh!
There was an error while loading. Please reload this page.


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 is a separable change from the toc headers if that would be better to consider separately!
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.
What does this change?
For example, these both go down to 2.5.4.1, so I guess it's something else?
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.
Just the depth of this page: https://cpython-previews--123453.org.readthedocs.build/en/123453/contents.html
We can remove this change or increase the number or whatever works, that page is just at the top of the hierarchy (and what you get bumped to whenever you click "up" in the ToC currently), and so if the hierarchy was easier to ascend and descend, then I thought it might be easier to have that page not list every child page, but a shorter view that can then be expanded.
But I don't want it to be a blocker for the main TOC header change, so if its controversial we can drop it.