summaryrefslogtreecommitdiffstats
path: root/Doc/tools
diff options
context:
space:
mode:
authorWilliam Andrea <william.j.andrea@gmail.com>2024-01-09 02:47:59 (GMT)
committerGitHub <noreply@github.com>2024-01-09 02:47:59 (GMT)
commitf3d5d4aa8f0388217aeff69e28d078bdda464b38 (patch)
tree40a59b0ce25fa0591ed6ac5be5aa00c30bcd8bcd /Doc/tools
parenta023bc252dc744736bd21897c5a23a25b800df92 (diff)
downloadcpython-f3d5d4aa8f0388217aeff69e28d078bdda464b38.zip
cpython-f3d5d4aa8f0388217aeff69e28d078bdda464b38.tar.gz
cpython-f3d5d4aa8f0388217aeff69e28d078bdda464b38.tar.bz2
Docs: Link tokens in the format string grammars (#108184)
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')
-rw-r--r--Doc/tools/.nitignore1
-rw-r--r--Doc/tools/extensions/pyspecific.py5
2 files changed, 5 insertions, 1 deletions
diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore
index c4f9b07..d80af40 100644
--- a/Doc/tools/.nitignore
+++ b/Doc/tools/.nitignore
@@ -77,7 +77,6 @@ Doc/library/smtplib.rst
Doc/library/socket.rst
Doc/library/ssl.rst
Doc/library/stdtypes.rst
-Doc/library/string.rst
Doc/library/subprocess.rst
Doc/library/termios.rst
Doc/library/test.rst
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
index 31c2544..cd44183 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