Skip to content

docs: ref redirector - #15432

Merged
ilevkivskyi merged 1 commit into
python:masterfrom
ikonst:06-14-docs_ref_redirector
Jun 14, 2023
Merged

ilevkivskyi merged 1 commit into
python:masterfrom
ikonst:06-14-docs_ref_redirector

Conversation

@ikonst

@ikonst ikonst commented Jun 14, 2023 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
@ikonst
ikonst deleted the 06-14-docs_ref_redirector branch June 14, 2023 12:36
@ikonst

ikonst commented Jun 14, 2023

Copy link
Copy Markdown
Contributor Author

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

@ilevkivskyi

Copy link
Copy Markdown
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

2 participants