8000 Docs: add link roles with Sphinx extlinks by hugovk · Pull Request #117850 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Docs 8000 : add link roles with Sphinx extlinks #117850

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

Merged
merged 5 commits into from
Apr 15, 2024
Merged

Conversation

hugovk
Copy link
Member
@hugovk hugovk commented Apr 13, 2024

The extlinks Sphinx module (since Sphinx 1.0) allows us to easily create roles by defining a dict mapping to conf.py:

We can use this to replace the custom :source: role defined in Doc/tools/extension/pyspecific.py with a single dict entry.

It's also useful to add handy roles for CVEs, CWEs, and PyPI project links. If the URL scheme changes in the future (as has happened with PyPI, and others when going http->https) we can update all the links by only changing one line of config.

This PR also adds links to a number previously unlinked CVE IDs.

I'll add these new roles to the devguide after merge:


We could also replace the custom :gh: and :issue: roles, but they perform useful validation (no BPO issues numbered 47261 - 400000, no GitHub issues < 32426).


📚 Documentation preview 📚: https://cpython-previews--117850.org.readthedocs.build/

8000
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@hugovk hugovk merged commit 3375282 into python:main Apr 15, 2024
@hugovk hugovk deleted the docs-extlinks branch April 15, 2024 18:22
@miss-islington-app
Copy link

Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @hugovk, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 3375282bb894347b73c11752f0797d90dadaf465 3.12

hugovk added a commit to hugovk/cpython that referenced this pull request Apr 15, 2024
(cherry picked from commit 3375282)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-app
Copy link
bedevere-app bot commented Apr 15, 2024

GH-117910 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Apr 15, 2024
hugovk added a commit that referenced this pull request Apr 15, 2024
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0