Skip to content

Commit

Permalink
updated release note generation
Browse files Browse the repository at this point in the history
  • Loading branch information
twihno committed Jul 14, 2021
1 parent 6c554a5 commit 3181e3c
Showing 1 changed file with 40 additions and 13 deletions.
53 changes: 40 additions & 13 deletions generate_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
TEMPLATE_DIR = "templates"

if __name__ == "__main__":
# Load paperlibgroups
paperlibgroups = []

for subdir, dirs, files in os.walk(TEMPLATE_DIR):
Expand All @@ -19,25 +20,51 @@

paperlibgroups.sort()

# Load paperlibcategories
paperlibcategories = []

for subdir, dirs, files in os.walk(TEMPLATE_DIR):
for file in files:
if file == "paperlibcategory.json":
with open(os.path.join(subdir, file), "r") as f:
paperlibcategories_dict = json.load(f)
paperlibcategories.append(
[paperlibcategories_dict["category_name"],
subdir,
paperlibcategories_dict["description"]])

paperlibcategories.sort()

with open("./output/README.md", "w") as f:
f.write("Version {}\n\n---\n\n".format(date.today().strftime("%Y-%m-%d")))
f.write("# Included templates\n")

for lib in paperlibgroups:
f.write("\n## {}\n{}\n\n".format(
f.write("\n## {}\n{}\n".format(
lib[0],
lib[2]
))

for subdir, dirs, files in os.walk(TEMPLATE_DIR):
for file in files:
if file == "printablepaperlib.json":
if subdir.startswith(lib[1]):
with open(os.path.join(subdir, file), "r") as j:
printablepaperlib_dict = json.load(j)
f.write(
"- {} (v{})\n".format(
printablepaperlib_dict["template_name"].replace(
"_", "\\_"),
printablepaperlib_dict["version"]
))
for cat in paperlibcategories:
if not(cat[1].startswith(lib[1]+"/")):
break

f.write("\n### {}\n{}\n\n".format(
cat[0],
cat[2]
))

for subdir, dirs, files in os.walk(TEMPLATE_DIR):
print(subdir, dirs, files)
for file in files:
if file == "printablepaperlib.json":
if subdir.startswith(lib[1]+"/") and subdir.startswith(cat[1]+"/"):
print(subdir)
with open(os.path.join(subdir, file), "r") as j:
printablepaperlib_dict = json.load(j)
f.write(
"- {} (v{})\n".format(
printablepaperlib_dict["template_name"].replace(
"_", "\\_"),
printablepaperlib_dict["version"]
))

0 comments on commit 3181e3c

Please sign in to comment.