|
34 | 34 |
|
35 | 35 |
|
36 | 36 | ISSUE_URI = 'https://bugs.python.org/issue%s' |
37 | | -SOURCE_URI = 'https://hg.python.org/cpython/file/3.5/%s' |
| 37 | +SOURCE_URI = 'https://github.com/python/cpython/tree/3.5/%s' |
38 | 38 |
|
39 | 39 | # monkey-patch reST parser to disable alphabetic and roman enumerated lists |
40 | 40 | from docutils.parsers.rst.states import Body |
@@ -79,7 +79,7 @@ def new_depart_literal_block(self, node): |
79 | 79 |
|
80 | 80 | def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): |
81 | 81 | issue = utils.unescape(text) |
82 | | - text = 'issue ' + issue |
| 82 | + text = 'bpo-' + issue |
83 | 83 | refnode = nodes.reference(text, text, refuri=ISSUE_URI % issue) |
84 | 84 | return [refnode], [] |
85 | 85 |
|
@@ -225,7 +225,7 @@ def run(self): |
225 | 225 |
|
226 | 226 | # Support for including Misc/NEWS |
227 | 227 |
|
228 | | -issue_re = re.compile('([Ii])ssue #([0-9]+)') |
| 228 | +issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)') |
229 | 229 | whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$") |
230 | 230 |
|
231 | 231 |
|
@@ -253,7 +253,7 @@ def run(self): |
253 | 253 | text = 'The NEWS file is not available.' |
254 | 254 | node = nodes.strong(text, text) |
255 | 255 | return [node] |
256 | | - content = issue_re.sub(r'`\1ssue #\2 <https://bugs.python.org/\2>`__', |
| 256 | + content = issue_re.sub(r'`bpo-\1 <https://bugs.python.org/issue\1>`__', |
257 | 257 | content) |
258 | 258 | content = whatsnew_re.sub(r'\1', content) |
259 | 259 | # remove first 3 lines as they are the main heading |
|
0 commit comments