Updated generation script

This commit is contained in:
Lucas
2025-03-18 11:42:54 -07:00
parent 9933ffd434
commit e87f57d58d
15 changed files with 3004 additions and 905 deletions

View File

@@ -1,10 +1,10 @@
import json
def load_categories():
with open("categories.json", "r", encoding="utf-8") as f:
with open("source/data/categories.json", "r", encoding="utf-8") as f:
return json.load(f)
def generate_table_of_contents():
def generate_tableofcontents():
data = load_categories()
categories = sorted(data["categories"], key=lambda x: x["Name"].lower())
subcategories = sorted(data["subcategories"], key=lambda x: x["Name"].lower())
@@ -44,7 +44,7 @@ def generate_table_of_contents():
return "\n".join(toc)
if __name__ == "__main__":
toc_content = generate_table_of_contents()
toc_content = generate_tableofcontents()
with open("tableofcontents.md", "w", encoding="utf-8") as f:
f.write(toc_content)
print("Generated tableofcontents.md")