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
intersphinx: Allow strict prefix matching #8981
Conversation
This is not yet merged feature in Sphinx, see sphinx-doc/sphinx#8981
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.
LGTM with nits.
@@ -173,6 +181,7 @@ def test_missing_reference_pydomain(tempdir, app, status, warning): | |||
'https://docs.python.org/': inv_file, | |||
} | |||
app.config.intersphinx_cache_limit = 0 | |||
app.config.intersphinx_strict_prefix = False |
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.
Is this initialization needed? I think the configuration is initialized as False
by default. So this assignment is not needed. I understand setting it up explicitly in test_missing_reference. But I don't understand why are they added in other cases.
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.
I didn't work without that. Unfortunately, I have no clue how this works in the tests...
fae9362
to
350ef53
Compare
Hmm, I'm not sure this is a descriptive name for the feature. How about something like |
As for name, I'm open to change it to anything. Changing intersphinx massively is something I can't do. Having a dedicated role for intersphinx as you describe #8418 (comment) and having a way to disable handling of missing references would work for us as well. The drawback of this approach might be that it would require new Sphinx to build, while changing way the lookups works as done in this PR would keep the documentation compatible with current Sphinx as well (only the strict lookup would not be performed, what is fine as long as we do the validation in CI using compatible version). I want to explicitly define where interphinx should be used and let Sphinx fail on missing references instead of silently picking up a reference from random linked documentation which happens to have a target which we forgot to define. |
it would be incredibly useful to have this feature added. without it intersphinx is basically unusable for versioning |
…#16155) This PR - adds a patched version of intersphinx (~from sphinx-doc/sphinx#8981) - uses versioned refs for version history - cleans up inline literals in version history Signed-off-by: Ryan Northey <ryan@synca.io>
…envoyproxy#16155) This PR - adds a patched version of intersphinx (~from sphinx-doc/sphinx#8981) - uses versioned refs for version history - cleans up inline literals in version history Signed-off-by: Ryan Northey <ryan@synca.io> Signed-off-by: Gokul Nair <gnair@twitter.com>
@nijel do you still need this ? Any chance of rebasing/updating to resolve conflicts ? if not, i could possibly take on this PR as it would be helpful to us to have this landed upstream |
Strictly using prefix for intersphinx links gives a better control on external links - only links explicitely declared will point to the external documentation. Fixes sphinx-doc#2068
I've just rebased it... |
In connection with some of the other recent intersphinx discussions I think a single config var is too limiting. For example, one may like to disable intersphinx lookup for roles like |
this sounds useful but my feeling is that it adds 2 layers of complexity just being able to disable the lookup up for non explicitly tagged links is incredibly useful if you want to use intersphinx with different versions of the same docs (we are using @nijel 's patch and its working v well) how about we land this and then i would potentially be up for contributing further in terms of adding more fine-grained controls over intersphinx lookups |
Fixes sphinx-doc#2068 Replaces sphinx-doc#8981
See #9459 for an implementation of #8981 (comment). |
Fixes sphinx-doc#2068 Replaces sphinx-doc#8981
Fixes sphinx-doc#2068 Replaces sphinx-doc#8981
Fixes sphinx-doc#2068 Replaces sphinx-doc#8981
Fixes sphinx-doc#2068 Replaces sphinx-doc#8981
Replaced by #9459, specifically by setting |
Subject: Add optional strict prefix matching to intersphinx
Feature or Bugfix
Purpose
Detail
Strictly using prefix for intersphinx links gives a better control on
external links - only links explicitely declared will point to the
external documentation.
Fixes #2068
Relates