[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 f3d5d4aa8f)

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>
This commit is contained in:
Miss Islington (bot) 2024-01-09 03:54:07 +01:00 committed by GitHub
parent 0b31a50ecd
commit cd87737a1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 8 deletions

View file

@ -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