Skip to content

Commit

Permalink
Linkify the PEP numbers in "Superseded-By" header. (#726)
Browse files Browse the repository at this point in the history
We're already linking PEP numbers in "Replaces:", and "Requires:".
Adjusted the code so it can link "Superseded-By:".
Add the "Replaces:" header where they're missing.
  • Loading branch information
Mariatta committed Jul 10, 2018
1 parent 9c61127 commit 3c0a1e1
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions pep-0101.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Type: Informational
Content-Type: text/x-rst
Created: 22-Aug-2001
Post-History:
Replaces: 102


Abstract
Expand Down
1 change: 1 addition & 0 deletions pep-0292.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Content-Type: text/x-rst
Created: 18-Jun-2002
Python-Version: 2.4
Post-History: 18-Jun-2002, 23-Mar-2004, 22-Aug-2004
Replaces: 215


Abstract
Expand Down
1 change: 1 addition & 0 deletions pep-0435.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Content-Type: text/x-rst
Created: 2013-02-23
Python-Version: 3.4
Post-History: 2013-02-23, 2013-05-02
Replaces: 354
Resolution: https://mail.python.org/pipermail/python-dev/2013-May/126112.html


Expand Down
1 change: 1 addition & 0 deletions pep-0446.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Type: Standards Track
Content-Type: text/x-rst
Created: 5-August-2013
Python-Version: 3.4
Replaces: 433


Abstract
Expand Down
1 change: 1 addition & 0 deletions pep-3156.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Type: Standards Track
Content-Type: text/x-rst
Created: 12-Dec-2012
Post-History: 21-Dec-2012
Replaces: 3153
Resolution: https://mail.python.org/pipermail/python-dev/2013-November/130419.html

Abstract
Expand Down
4 changes: 2 additions & 2 deletions pep2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def fixfile(inpath, input_lines, outfile):
else:
mailtos.append(part)
v = COMMASPACE.join(mailtos)
elif k.lower() in ('replaces', 'replaced-by', 'requires'):
elif k.lower() in ('replaces', 'superseded-by', 'requires'):
otherpeps = ''
for otherpep in re.split(',?\s+', v):
otherpep = int(otherpep)
Expand Down Expand Up @@ -409,7 +409,7 @@ def apply(self):
for node in para:
if isinstance(node, nodes.reference):
node.replace_self(peps.mask_email(node, pep))
elif name in ('replaces', 'replaced-by', 'requires'):
elif name in ('replaces', 'superseded-by', 'requires'):
newbody = []
space = nodes.Text(' ')
for refpep in re.split(r',?\s+', body.astext()):
Expand Down
2 changes: 1 addition & 1 deletion pep2pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def fixfile(inpath, input_lines, outfile):
else:
mailtos.append(part)
v = COMMASPACE.join(mailtos)
elif k.lower() in ('replaces', 'replaced-by', 'requires'):
elif k.lower() in ('replaces', 'superseded-by', 'requires'):
otherpeps = ''
for otherpep in re.split(',?\s+', v):
otherpep = int(otherpep)
Expand Down

0 comments on commit 3c0a1e1

Please sign in to comment.