mark up release notes as articles

This commit is contained in:
Daniel Micay 2020-12-02 13:35:59 -05:00
parent abc83cbed6
commit 9231fb02a4
2 changed files with 1512 additions and 1416 deletions

View File

@ -6,7 +6,7 @@ import lxml.html
from lxml import etree from lxml import etree
document = lxml.html.parse("static_tmp/releases.html").getroot() document = lxml.html.parse("static_tmp/releases.html").getroot()
releases = document.body.cssselect("#changelog h3") releases = document.body.cssselect("#changelog article")
updated = None updated = None
entries = [] entries = []
@ -16,11 +16,7 @@ for release in releases:
time = datetime.strptime(title, "%Y.%m.%d.%H").isoformat() + "Z" time = datetime.strptime(title, "%Y.%m.%d.%H").isoformat() + "Z"
if updated is None: if updated is None:
updated = time updated = time
content = [] content = [etree.tostring(e).decode() for e in release.getchildren()[1:]]
element = release.getnext()
while element is not None and element.tag != "h3":
content.append(etree.tostring(element).decode())
element = element.getnext()
entry = f"""\ entry = f"""\
<entry> <entry>
<id>https://grapheneos.org/releases#{title}</id> <id>https://grapheneos.org/releases#{title}</id>

File diff suppressed because it is too large Load Diff