summaryrefslogtreecommitdiffstats
path: root/Doc/tools/extensions/pyspecific.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-01-09 02:54:07 (GMT)
committerGitHub <noreply@github.com>2024-01-09 02:54:07 (GMT)
commitcd87737a1de9a3b766358912985ffae511c3911d (patch)
treef573b5b6c15abf7e998f488c122e672e0e545a7c /Doc/tools/extensions/pyspecific.py
parent0b31a50ecd494d76e4254d4b2de18e5926683124 (diff)
downloadcpython-cd87737a1de9a3b766358912985ffae511c3911d.zip
cpython-cd87737a1de9a3b766358912985ffae511c3911d.tar.gz
cpython-cd87737a1de9a3b766358912985ffae511c3911d.tar.bz2
[3.12] Docs: Link tokens in the format string grammars (GH-108184) (#113839)
Docs: Link tokens in the format string grammars (GH-108184) (cherry picked from commit f3d5d4aa8f0388217aeff69e28d078bdda464b38) Co-authored-by: William Andrea <william.j.andrea@gmail.com> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Diffstat (limited to 'Doc/tools/extensions/pyspecific.py')
-rw-r--r--Doc/tools/extensions/pyspecific.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
index cdb8cf8..c29846e 100644
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -48,6 +48,11 @@ Body.enum.converters['loweralpha'] = \
Body.enum.converters['lowerroman'] = \
Body.enum.converters['upperroman'] = lambda x: None
+# monkey-patch the productionlist directive to allow hyphens in group names
+# https://github.com/sphinx-doc/sphinx/issues/11854
+from sphinx.domains import std
+
+std.token_re = re.compile(r'`((~?[\w-]*:)?\w+)`')
# Support for marking up and linking to bugs.python.org issues