diff options
author | Dong-hee Na <donghee.na@python.org> | 2022-05-08 12:50:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-08 12:50:40 (GMT) |
commit | 45e1721d100bab09510ccf9da49f14ca5cc268f4 (patch) | |
tree | 5395237da6c332231a88bce409797ea6eb71b1c2 /Doc/tools/extensions | |
parent | d284e8b3e351c69406519d5afdcdbed7fbbe0190 (diff) | |
download | cpython-45e1721d100bab09510ccf9da49f14ca5cc268f4.zip cpython-45e1721d100bab09510ccf9da49f14ca5cc268f4.tar.gz cpython-45e1721d100bab09510ccf9da49f14ca5cc268f4.tar.bz2 |
gh-92448: Update the documentation builder to render the GitHub issue. (GH-92449)
Diffstat (limited to 'Doc/tools/extensions')
-rw-r--r-- | Doc/tools/extensions/pyspecific.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 12b98f4..2e122b5 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -429,7 +429,8 @@ class DeprecatedRemoved(Directive): # Support for including Misc/NEWS -issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)') +issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)', re.I) +gh_issue_re = re.compile('(?:gh-issue-|gh-)([0-9]+)', re.I) whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$") @@ -456,9 +457,9 @@ class MiscNews(Directive): text = 'The NEWS file is not available.' node = nodes.strong(text, text) return [node] - content = issue_re.sub(r'`bpo-\1 <https://bugs.python.org/' - r'issue?@action=redirect&bpo=\1>`__', - content) + content = issue_re.sub(r':issue:`\1`', content) + # Fallback handling for the GitHub issue + content = gh_issue_re.sub(r':gh:`\1`', content) content = whatsnew_re.sub(r'\1', content) # remove first 3 lines as they are the main heading lines = ['.. default-role:: obj', ''] + content.splitlines()[3:] |