Skip to content

Docs: add link roles with Sphinx extlinks#117850

Merged
hugovk merged 5 commits intopython:mainfrom
hugovk:docs-extlinks
Apr 15, 2024
Merged

Docs: add link roles with Sphinx extlinks#117850
hugovk merged 5 commits intopython:mainfrom
hugovk:docs-extlinks

Conversation

@hugovk
Copy link
Copy Markdown
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/

Comment thread Doc/whatsnew/3.12.rst Outdated
Comment thread Doc/whatsnew/3.12.rst Outdated
Comment thread Doc/whatsnew/3.13.rst Outdated
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
Copy Markdown

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

@miss-islington-app
Copy link
Copy Markdown

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

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