Handle explicit intersphinx inventory names in all domains #236
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.
Intersphinx supports explicitly specifying the inventory name in a link target, e.g. the
python:
part in:ref:`python:datetime-datetime`
.The custom
missing_reference
hook in hoverxref handles such target names as well, but only in thestd
domain (as far as I can tell, particularly for:ref:
, which is in thestd
domain).Intersphinx supports target names with explicit inventories regardless of role/domain, which means
:py:attr:`python:datetime.time.minute`
results in the correct link, but without the hoverxref popup as thepython:
prefix isn't handled by hoverxref in this case.This PR attempts to fix this by removing the check for the
std
domain, which I believe intersphinx also doesn't check.I'm very much not sure if this makes sense with how Sphinx, Intersphinx and sphinx-hoverxref interact, or if there are side-effects, I don't know a whole lot about Sphinx internals 😅 Nevertheless, this fixes the aforementioned issue, and tests pass fine :)
The difference between sphinx-hoverxref 1.2.0 and this PR can be seen here:
Note the difference on the second
:attr:
link, while hovering over the second:ref:
link works in both versions.📚 Documentation preview 📚: https://sphinx-hoverxref--236.org.readthedocs.build/en/236/
📚 Documentation preview 📚: https://read-the-docs-sphinx-hoverxref--236.com.readthedocs.build/en/236/