Docs: Built-in Functions: Make missing functions appear in side nav #128010
+10
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On the left side of https://docs.python.org/3/library/functions.html there is a gray side nav with a title at the top that says "Table of Contents". In that side nav there are many links to sections of that same page, but I noticed that there is no link to
list()
even though there is an entry forlist()
in the page.This PR fixes that problem, but causes other problems. I don't know what the best solution is.
When I looked at the entry for
list()
inDoc/library/functions.rst
I saw that there is a:noindex:
directive on that entry. I also noticed that there are:noindex:
directives on several other entries in that doc page. I tried removing them all and ranmake htmlview
, but then I noticed warning messages in the output ofmake htmlview
that said, for example:I found this Sphinx documentation that talks about directives that are similar to
:noindex:
. I don't fully understand it. I tried replacing all the:noindex:
directives infunctions.rst
with:no-index-entry:
directives. I noticed two effects from doing that:(Good) It silenced the warnings and the entries appeared in the side nav.(Actually I can't get those warnings to show up anymore no matter what I do, even if I delete theDoc/build/
directory and runmake htmlview
again.):noindex:
and:no-index-entry:
are used on thelist()
entry inDoc/library/functions.rst
::noindex:
, the fifth search result for "list" is "list (Python class, in Built-in Types)" and links toDoc/library/stdtypes.rst#list
.:no-index-entry:
, the fifth search result for "list" is "list (Python class, in Built-in Functions)" and links toDoc/library/functions.rst#list
. (Also, the entry forlist()
infunctions.rst
attempts to link to the entry instdtypes.rst
, but the link instead now links back to the same entry infunctions.rst
.)Since the definition in
stdtypes.rst
is more complete, changing the search result forlist()
is undesirable.Does anyone know a way to make these entries show up in the side nav on the
functions.rst
page without changing other behaviors? Maybe instead of auto-generating the side nav content it could be manually, explicitly defined?📚 Documentation preview 📚: https://cpython-previews--128010.org.readthedocs.build/