Open jayaddison opened 1 week ago
Using a boolean-typed field, perhaps named
is_local
or simplylocal
. This would work equally well provided that locality preserves this clear distinction -- and it may well do -- but to me it feels worth having some potential for extensibility.
Two additional locality
values I can think of are: cache
(according to a recent local cached result, the status of the hyperlink is ...) and archive
(according to a nearby, but not necessarily same-host, archived result, the status of the hyperlink is ...).
Is your feature request related to a problem? Please describe. The
linkcheck
builder is capable of checking hyperlinks that refer to network resources, and also a limited set of host-local filesystem resources.Currently, the locality of the hyperlink is not included in the
linkcheck
report output; despite that, in many cases it's probably fairly clear whether each hyperlink is to a local path or remote, by inspection.Describe the solution you'd like Although inspecting URIs is possible, I think it might be helpful to add a string-typed
locality
report field that indicates whether the linkcheck builder considered each hyperlink to belocal
orremote
at runtime.Describe alternatives you've considered
is_local
or simplylocal
. This would work equally well provided that locality preserves this clear distinction -- and it may well do -- but to me it feels worth having some potential for extensibility.Additional context
local
link handling: https://github.com/sphinx-doc/sphinx/blob/9f4c61b15415bcb219c3e238092421738b2a677e/sphinx/builders/linkcheck.py#L104-L106 (essentially: non-HTTP(S) links)//
prefix (NB: I'm not sure a//
is necessarily always required for network-based resources, but it often is in practice).