2022-01-25 07:35:24 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
"""
|
|
|
|
Generates a more user-readable changelog from changelog.yaml.
|
|
|
|
"""
|
|
|
|
|
|
|
|
import textwrap
|
|
|
|
import yaml
|
|
|
|
|
|
|
|
with open("changelog.yaml", "r") as f:
|
|
|
|
data = yaml.safe_load(f)
|
|
|
|
|
|
|
|
print("twitch-dl changelog")
|
|
|
|
print("===================")
|
|
|
|
print()
|
|
|
|
print("<!-- Do not edit. This file is automatically generated from changelog.yaml.-->")
|
|
|
|
print()
|
|
|
|
|
|
|
|
for version in data.keys():
|
|
|
|
date = data[version]["date"]
|
|
|
|
changes = data[version]["changes"]
|
2022-02-23 20:54:56 +00:00
|
|
|
print(f"### [{version} ({date})](https://github.com/ihabunek/twitch-dl/releases/tag/{version})")
|
2022-01-25 07:35:24 +00:00
|
|
|
print()
|
2022-08-17 08:56:54 +00:00
|
|
|
|
|
|
|
if "description" in data[version]:
|
|
|
|
description = data[version]["description"].strip()
|
|
|
|
for line in textwrap.wrap(description, 80):
|
|
|
|
print(line)
|
|
|
|
print()
|
|
|
|
|
2022-01-25 07:35:24 +00:00
|
|
|
for c in changes:
|
|
|
|
lines = textwrap.wrap(c, 78)
|
|
|
|
initial = True
|
|
|
|
for line in lines:
|
|
|
|
if initial:
|
|
|
|
print("* " + line)
|
|
|
|
initial = False
|
|
|
|
else:
|
|
|
|
print(" " + line)
|
|
|
|
print()
|