Store changelog snippets as .md

This commit is contained in:
dbr 2021-09-05 17:02:48 +10:00
parent e8a4d8029b
commit 8ca7f70cef
2 changed files with 3 additions and 3 deletions

View file

@ -58,7 +58,7 @@ In order to manage this, changelog entries are stored as text files in the `.cha
To add a new changelog entry, you can simply run `python3 ./script/changelog.py add "Fixed thingo to increase zorbloxification [Issue #2](http://example.com)`
This creates a file named `./changelogs/yyyy-mm-dd-branchname.txt` (timestamp, current git branch) which contains a markdown snippet.
This creates a file named `./changelogs/yyyy-mm-dd-branchname.md` (timestamp, current git branch) which contains a markdown snippet.
If you don't have a Python 3 intepreter installed, you can simply create this file manually. It should contain a list item like `- Fixed thingo [...]`

View file

@ -22,7 +22,7 @@ def get_changefiles() -> List[str]:
changedir = get_dir()
changefiles = []
for f in os.listdir(changedir):
if f.endswith(".txt") and not f.startswith("."):
if f.endswith(".md") and not f.startswith("."):
changefiles.append(os.path.join(changedir, f))
return changefiles
@ -34,7 +34,7 @@ def cmd_add(args):
timestamp = ymd()
branchname = git_current_branch()
fname = os.path.join(get_dir(), "%s-%s.txt" % (timestamp, branchname))
fname = os.path.join(get_dir(), "%s-%s.md" % (timestamp, branchname))
with open(fname, "a") as f:
f.write(text)
f.write("\n")