Skip to content

Remove unnecessary usages of .. index:: directives in Doc/library/uuid.rst #130461

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

Closed
picnixz opened this issue Feb 22, 2025 · 7 comments · Fixed by #130526
Closed

Remove unnecessary usages of .. index:: directives in Doc/library/uuid.rst #130461

picnixz opened this issue Feb 22, 2025 · 7 comments · Fixed by #130526
Labels
docs Documentation in the Doc dir

Comments

@picnixz
Copy link
Member

picnixz commented Feb 22, 2025

See #120650 (comment).

We use .. index:: single: uuidN and other .. index:: directives in the UUID documentation. However, the anchor is after the actual function, meaning that https://docs.python.org/3/library/uuid.html#index-6 jumps to uuid3 instead of uuid1 for instance (compare with https://docs.python.org/3/library/uuid.html#uuid.uuid1).

OTOH, we could simply remove the .. index usages but I don't remember whether they are intersphinxed or not.

cc @AA-Turner @hugovk

Linked PRs

@picnixz picnixz added the docs Documentation in the Doc dir label Feb 22, 2025
@Mr-Sunglasses
Copy link
Contributor

See #120650 (comment).

We use .. index:: single: uuidN and other .. index:: directives in the UUID documentation. However, the anchor is after the actual function, meaning that https://docs.python.org/3/library/uuid.html#index-6 jumps to uuid3 instead of uuid1 for instance (compare with https://docs.python.org/3/library/uuid.html#uuid.uuid1).

OTOH, we could simply remove the .. index usages but I don't remember whether they are intersphinxed or not.

cc @AA-Turner @hugovk

@picnixz , I've investigated this issue by removing .. index and yeah they are intersphinxed, by removing them they does not show on the index page, do I find a fix, by adding .. index above .. function:: this will fix it.

@picnixz
Copy link
Member Author

picnixz commented Feb 22, 2025

I've investigated this issue by removing .. index and yeah they are intersphinxed, by removing them they does not show on the index page, do I find a fix, by adding .. index above .. function:: this will fix it.

Someone might rely on them in the wild, although I doubt (because to know about it, you need to know about the RST source itself). However, there could some crawlers that do the task automatically. I don't know whether it's good or not to remove them (I feel they just duplicate the .. function:: uuid1 entry, so it's not really useful).

Note that searching uuid1 would give you the function and not the index. The index would be at the end of the search results (see https://docs.python.org/3/search.html?q=uuid1 for instance).

@AA-Turner do you think we can just remove those .. index::? I think it's pretty the only place in the docs where we use both an index and a function directive. Other places benefit from .. index:: as they use other search terms but in this case, I don't think it's really needed.

@picnixz
Copy link
Member Author

picnixz commented Feb 22, 2025

Also, the plain rendering of those indices is not really good. I think it's better to just keep the entry with (in module uuid) (this is the entry associated with .. function:: uuidX()).

Image

Mr-Sunglasses added a commit to Mr-Sunglasses/cpython that referenced this issue Feb 22, 2025
@Mr-Sunglasses
Copy link
Contributor

Also, the plain rendering of those indices is not really good. I think it's better to just keep the entry with (in module uuid) (this is the entry associated with .. function:: uuidX()).

Image

Yes totally agree, the plain entry really looks bad, so we can totally remove it if we want, (in module uuid) entry is good and enough at all.

@picnixz picnixz changed the title Fix locations of .. index:: directives usage in Doc/library/uuid.rst Fix locations or remove usages of .. index:: directives usage in Doc/library/uuid.rst Feb 22, 2025
@picnixz picnixz changed the title Fix locations or remove usages of .. index:: directives usage in Doc/library/uuid.rst Fix locations or remove usages of .. index:: directives in Doc/library/uuid.rst Feb 22, 2025
@hugovk
Copy link
Member

hugovk commented Feb 23, 2025

@AA-Turner do you think we can just remove those .. index::? I think it's pretty the only place in the docs where we use both an index and a function directive. Other places benefit from .. index:: as they use other search terms but in this case, I don't think it's really needed.

Remove, and if anyone complains, re-add them? (aka a scream test :)

@picnixz
Copy link
Member Author

picnixz commented Feb 23, 2025

Ok, let's just outright remove them. Those could even be legacy added and inspired from the old LaTeX docs (though I haven't checked). @Mr-Sunglasses Could you amend your PR and simply remove the .. index:: directives please? You can also add a NEWS entry saying that the corresponding indices were removed from the intersphinx inventory just in case (that way, if people want to scream, they know on which issue to scream)

@picnixz picnixz changed the title Fix locations or remove usages of .. index:: directives in Doc/library/uuid.rst Remove unnecessary usages of .. index:: directives in Doc/library/uuid.rst Feb 23, 2025
@Mr-Sunglasses
Copy link
Contributor

Mr-Sunglasses commented Feb 24, 2025

Ok, let's just outright remove them. Those could even be legacy added and inspired from the old LaTeX docs (though I haven't checked). @Mr-Sunglasses Could you amend your PR and simply remove the .. index:: directives please? You can also add a NEWS entry saying that the corresponding indices were removed from the intersphinx inventory just in case (that way, if people want to scream, they know on which issue to scream)

Sure @picnixz I'l do it in #130526 PR :-)

Mr-Sunglasses pushed a commit to Mr-Sunglasses/cpython that referenced this issue Feb 24, 2025
…:` (python#130448)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>

pythongh-130461: Fix locations of `.. index::` directives usage in `Doc/library/uuid.rst`

pythongh-130461: Fix locations of `.. index::` in `getnode()`
Mr-Sunglasses added a commit to Mr-Sunglasses/cpython that referenced this issue Feb 24, 2025
Mr-Sunglasses added a commit to Mr-Sunglasses/cpython that referenced this issue Feb 24, 2025
hugovk pushed a commit that referenced this issue Feb 25, 2025
…c/library/uuid.rst (#130526)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Mr-Sunglasses added a commit to Mr-Sunglasses/cpython that referenced this issue Feb 25, 2025
… in Doc/library/uuid.rst (python#130526)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
(cherry picked from commit 85f1cc8)
hugovk pushed a commit that referenced this issue Feb 25, 2025
…s in Doc/library/uuid.rst (#130526) (#130548)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
hugovk added a commit that referenced this issue Feb 25, 2025
…s in Doc/library/uuid.rst (#130526) (#130546)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
… in Doc/library/uuid.rst (python#130526)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
Status: Todo
3 participants