Skip to content

Commit de82a01

Browse files
committed
Produce better Misc/NEWS output for Sphinx
1 parent e7ea718 commit de82a01

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

src/blurb/blurb.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ class BlurbError(RuntimeError):
399399
(This formatting will be inserted when rendering the final output.)
400400
* Lines longer than 76 characters will be wordwrapped.
401401
* In the final output, the first line will have
402-
"- gh-issue-<gh-issue-number>: " inserted at the front,
402+
"- :gh:`<gh-issue-number>`: " inserted at the front,
403403
and subsequent lines will have two spaces inserted
404404
at the front.
405405
@@ -989,13 +989,6 @@ def print(*a, sep=" "):
989989
s = sep.join(str(x) for x in a)
990990
return builtins.print(s, file=buff)
991991

992-
print ("""
993-
+++++++++++
994-
Python News
995-
+++++++++++
996-
997-
""".strip())
998-
999992
for version in versions:
1000993
filenames = glob_blurbs(version)
1001994

@@ -1013,7 +1006,7 @@ def print(*a, sep=" "):
10131006
assert len(filenames) == 1
10141007
blurbs.load(filenames[0])
10151008

1016-
header = "What's New in Python " + printable_version(version) + "?"
1009+
header = printable_version(version)
10171010
print()
10181011
print(header)
10191012
print("=" * len(header))
@@ -1042,14 +1035,13 @@ def print(*a, sep=" "):
10421035
if metadata.get("gh-issue"):
10431036
issue_number = metadata['gh-issue']
10441037
if int(issue_number):
1045-
body = "gh-" + issue_number + ": " + body
1038+
body = f":gh:`{issue_number}`: {body}"
10461039
elif metadata.get("bpo"):
10471040
issue_number = metadata['bpo']
10481041
if int(issue_number):
1049-
body = "bpo-" + issue_number + ": " + body
1042+
body = f":issue:`{issue_number}`: {body}"
10501043

1051-
body = "- " + body
1052-
text = textwrap_body(body, subsequent_indent=' ')
1044+
text = textwrap_body(f"- {body}", subsequent_indent=' ')
10531045
print(text)
10541046
print()
10551047
print("**(For information about older versions, consult the HISTORY file.)**")

0 commit comments

Comments
 (0)