Skip to content

use intersphinx crossrefs to stdlib docs where possible instead of hardcoded URLs#9041

Merged
Zac-HD merged 1 commit intopytest-dev:mainfrom
hoefling:doc/stdlib-crossrefs
Sep 7, 2021
Merged

use intersphinx crossrefs to stdlib docs where possible instead of hardcoded URLs#9041
Zac-HD merged 1 commit intopytest-dev:mainfrom
hoefling:doc/stdlib-crossrefs

Conversation

@hoefling
Copy link
Copy Markdown
Member

This PR replaces hardcoded links to docs.python.org by intersphinx crossrefs where possible. The only URL that was left hardcoded is in how-to/unittest.rst, since the referenced section in stdlib docs (link) doesn't have any label.

…rdcoded URLs

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Copy link
Copy Markdown
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@Zac-HD
Copy link
Copy Markdown
Member

Zac-HD commented Sep 7, 2021

Thanks for catching this! Should we consider adding a CI check (git grep ...?) to make sure we don't introduce new cases?

We might also consider using extlinks so that we can write :issue:'1234' instead of the long link syntax (Hypothesis example), but IMO that's a separate PR.

@hoefling
Copy link
Copy Markdown
Member Author

hoefling commented Sep 7, 2021

@Zac-HD

Should we consider adding a CI check (git grep ...?) to make sure we don't introduce new cases?

Good idea! I'm using an extra sphinx builder (similar to linkcheck builder) for that in my projects, which checks all hardcoded links against hosts in intersphinx_mapping. Can add another PR that introduces this. IIRC there are also cases where hardcoded links can be replaced by intersphinx mappings that should be added first (e.g. refs to attrs or setuptools), but I didn't want to bloat the PR up any more.

We might also consider using extlinks

Yep, totally 👍

@RonnyPfannschmidt
Copy link
Copy Markdown
Member

lovely ideas, they will make fine follow-ups
do you want to create issues for them?

@Zac-HD
Copy link
Copy Markdown
Member

Zac-HD commented Sep 7, 2021

Issue opened! I particularly want to hear more about the builder; that sounds like a trick I'll want to copy for Hypothesis.

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.

3 participants