mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
gh-92448: Update the documentation builder to render the GitHub issue. (GH-92449)
This commit is contained in:
parent
d284e8b3e3
commit
45e1721d10
9 changed files with 15 additions and 14 deletions
|
@ -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:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue