mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 09:40:19 +01:00
devtools: Make the raw changelog more readable
The links were rather annoying in the flowing text, so extract them and add them to the footer of the release instead. This uses the shorthand and footnote style of links.
This commit is contained in:
parent
3105a7a204
commit
25aa05d26e
1 changed files with 22 additions and 1 deletions
|
@ -23,6 +23,7 @@ sections = [
|
||||||
repo = 'ElementsProject/lightning'
|
repo = 'ElementsProject/lightning'
|
||||||
|
|
||||||
Entry = namedtuple("Entry", ["commit", "pullreq", "content", "section"])
|
Entry = namedtuple("Entry", ["commit", "pullreq", "content", "section"])
|
||||||
|
Link = namedtuple("Link", ["ref", "content", "url"])
|
||||||
|
|
||||||
|
|
||||||
def git(cmd):
|
def git(cmd):
|
||||||
|
@ -75,6 +76,17 @@ def get_log_entries(commitrange):
|
||||||
return entries
|
return entries
|
||||||
|
|
||||||
|
|
||||||
|
def linkify(entries):
|
||||||
|
links = []
|
||||||
|
for e in entries:
|
||||||
|
links.append(Link(
|
||||||
|
ref='#{}'.format(e.pullreq),
|
||||||
|
content=e.content,
|
||||||
|
url="https://github.com/ElementsProject/lightning/pull/{}".format(e.pullreq)
|
||||||
|
))
|
||||||
|
return list(set(links))
|
||||||
|
|
||||||
|
|
||||||
def group(entries):
|
def group(entries):
|
||||||
groups = {s: [] for s in sections}
|
groups = {s: [] for s in sections}
|
||||||
for e in entries:
|
for e in entries:
|
||||||
|
@ -92,7 +104,12 @@ def commit_date(commitsha):
|
||||||
|
|
||||||
template = Template("""<%def name="group(entries)">
|
template = Template("""<%def name="group(entries)">
|
||||||
% for e in entries:
|
% for e in entries:
|
||||||
- ${e.content} ([${e.pullreq}](https://github.com/ElementsProject/lightning/pull/${e.pullreq}))
|
- ${e.content} ([#${e.pullreq}])
|
||||||
|
% endfor
|
||||||
|
|
||||||
|
</%def><%def name="group_links(entries)">
|
||||||
|
% for e in entries:
|
||||||
|
[${e.pullreq}]: https://github.com/ElementsProject/lightning/pull/${e.pullreq}
|
||||||
% endfor
|
% endfor
|
||||||
</%def>
|
</%def>
|
||||||
<!--
|
<!--
|
||||||
|
@ -118,6 +135,9 @@ ${group(groups['fixed']) | trim}
|
||||||
${h3} Security
|
${h3} Security
|
||||||
${group(groups['security']) | trim}
|
${group(groups['security']) | trim}
|
||||||
|
|
||||||
|
% for l in links:
|
||||||
|
[${l.ref}]: ${l.url}
|
||||||
|
% endfor
|
||||||
[${version}]: https://github.com/ElementsProject/lightning/releases/tag/v${version}""")
|
[${version}]: https://github.com/ElementsProject/lightning/releases/tag/v${version}""")
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,4 +166,5 @@ if __name__ == "__main__":
|
||||||
h3='###',
|
h3='###',
|
||||||
version=tocommit[1:],
|
version=tocommit[1:],
|
||||||
date=date,
|
date=date,
|
||||||
|
links=linkify(entries),
|
||||||
))
|
))
|
||||||
|
|
Loading…
Add table
Reference in a new issue