mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[3.12] Docs: add link roles with Sphinx extlinks (GH-117850) (#117910)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
6dfb7e1f27
commit
eb0bfb5910
65 changed files with 134 additions and 161 deletions
16
Doc/conf.py
16
Doc/conf.py
|
@ -12,6 +12,8 @@ import time
|
|||
sys.path.append(os.path.abspath('tools/extensions'))
|
||||
sys.path.append(os.path.abspath('includes'))
|
||||
|
||||
from pyspecific import SOURCE_URI
|
||||
|
||||
# General configuration
|
||||
# ---------------------
|
||||
|
||||
|
@ -24,6 +26,7 @@ extensions = [
|
|||
'pyspecific',
|
||||
'sphinx.ext.coverage',
|
||||
'sphinx.ext.doctest',
|
||||
'sphinx.ext.extlinks',
|
||||
]
|
||||
|
||||
# Skip if downstream redistributors haven't installed it
|
||||
|
@ -499,6 +502,19 @@ linkcheck_ignore = [
|
|||
r'https://unix.org/version2/whatsnew/lp64_wp.html',
|
||||
]
|
||||
|
||||
# Options for sphinx.ext.extlinks
|
||||
# -------------------------------
|
||||
|
||||
# This config is a dictionary of external sites,
|
||||
# mapping unique short aliases to a base URL and a prefix.
|
||||
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
|
||||
extlinks = {
|
||||
"cve": ("https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-%s", "CVE-%s"),
|
||||
"cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
|
||||
"pypi": ("https://pypi.org/project/%s/", "%s"),
|
||||
"source": (SOURCE_URI, "%s"),
|
||||
}
|
||||
extlinks_detect_hardcoded_links = True
|
||||
|
||||
# Options for extensions
|
||||
# ----------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue