Allow case-insensitive match of label-refs through intersphinx#12033
Merged
picnixz merged 1 commit intosphinx-doc:masterfrom Mar 2, 2024
Merged
Allow case-insensitive match of label-refs through intersphinx#12033picnixz merged 1 commit intosphinx-doc:masterfrom
picnixz merged 1 commit intosphinx-doc:masterfrom
Conversation
picnixz
approved these changes
Mar 2, 2024
Member
picnixz
left a comment
There was a problem hiding this comment.
Thank you. Can you add a CHANGES entry please?
Look up `:std:label:` object types case-insensitively in an intersphinx inventory. This is needed because `ref` and `numref` references (which both resolve to `:std:label:`) are case insensitive. They lowercase their target under the assumption that the target name in any inventory file is also lowercased. That assumption holds for labels in inventory files generated by Sphinx from `.rst` files, since it generates lowercase labels. However, other documentation generators (such as the Julia Documenter.jl, which also writes `objects.inv` inventory files as of version 1.3) use mixed-case labels for section title. With the change in this commit, if the lowercase label cannot be found in the inventory, also try a case-insensitive match. See sphinx-doc#12008
05223e0 to
fcf9c53
Compare
Contributor
Author
|
Done. Switched list of case-insensitive types to |
Member
|
Thank you! in the future, don't force push since we squash-merge anyway (sometimes it is easier to review without a force-push). |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Look up
:std:label:object types case-insensitively in an intersphinx inventory. This is needed becauserefandnumrefreferences (which both resolve to:std:label:) are case insensitive. They lowercase their target under the assumption that the target name in any inventory file is also lowercased.That assumption holds for labels in inventory files generated by Sphinx from
.rstfiles, since it generates lowercase labels. However, other documentation generators (such as the Julia Documenter.jl, which also writesobjects.invinventory files as of version 1.3) use mixed-case labels for section title.With the change in this commit, if the lowercase label cannot be found in the inventory, also try a case-insensitive match.
This PR is an alternative to #12009.
It uses the same resolution as was implemented in #9299 for the similar issue #9291 for
:term:references.Closes #12008