Skip to content
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

docs: ref redirector #15432

Merged
merged 1 commit into from
Jun 14, 2023
Merged

Conversation

ikonst
Copy link
Contributor

@ikonst ikonst commented Jun 14, 2023

Makes the HTML builder generate a _refs.html file that redirects (global) refs (when provided as a hash i.e. _refs.html#some-ref) to the appropriate document.

This allows tools (e.g. #15431) to link to well-known refs.

@ikonst ikonst force-pushed the 06-14-docs_ref_redirector branch from 7b0a4d1 to 05e2c7a Compare June 14, 2023 06:25
@ilevkivskyi
Copy link
Member

IIUC this only solves the problem of having two pages for errors, right? So that one would still need to write https://mypy.readthedocs.io/en/stable/_refs.html#check-calls-to-overloaded-functions-call-overload.

Maybe we can generate a mapping actual code -> currently used hash by parsing the rst source searching for [...] in section titles within error code files? Or by writing a plugin that would modify the hash to only the part that is within [...] of a section title?

@ilevkivskyi
Copy link
Member

Anyway, this is probably better to do in a separate PR, so merging this now.

@ilevkivskyi ilevkivskyi merged commit c63e873 into python:master Jun 14, 2023
2 checks passed
@ikonst ikonst deleted the 06-14-docs_ref_redirector branch June 14, 2023 12:36
@ikonst
Copy link
Contributor Author

ikonst commented Jun 14, 2023

Maybe we can autodoc them? And until we do, simply add anchors by search replace.

@ilevkivskyi
Copy link
Member

Yeah I already did this (with a simple sed style script) will make a PR soon.

hauntsaninja pushed a commit that referenced this pull request Jun 24, 2023
Makes the HTML builder generate a _refs.html file that redirects
(global) refs (when provided as a hash i.e. `_refs.html#some-ref`) to
the appropriate document.

This allows tools (e.g. #15431) to link to well-known refs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants