Update script markdown export

This commit is contained in:
Serene-Arc 2023-10-21 20:05:54 +10:00
parent 3c4c586fb1
commit 308f9f5f1c

View file

@ -117,16 +117,11 @@ def bump_version(version):
with open(filename, "w") as f: with open(filename, "w") as f:
f.write("".join(out_lines)) f.write("".join(out_lines))
# Generate bits to insert into changelog.
header_line = f"{version} (in development)"
header = "\n\n" + header_line + "\n" + "-" * len(header_line) + "\n\n"
header += "Changelog goes here!\n"
# Insert into the right place. # Insert into the right place.
with open(CHANGELOG) as f: with open(CHANGELOG) as f:
contents = f.read() contents = f.read()
location = contents.find("\n\n") # First blank line. location = contents.find("\n\n") # First blank line.
contents = contents[:location] + header + contents[location:] contents = contents[:location] + contents[location:]
# Write back. # Write back.
with open(CHANGELOG, "w") as f: with open(CHANGELOG, "w") as f:
@ -158,7 +153,7 @@ def get_latest_changelog():
elif started: elif started:
lines.append(line) lines.append(line)
return "".join(lines).strip() return "".join(lines[2:]).strip()
def rst2md(text): def rst2md(text):