mirror of
https://github.com/mustbeperfect/definitive-opensource.git
synced 2026-04-18 09:54:14 +02:00
Added tags.json, archive.json, and fixed json formatting
This commit is contained in:
@@ -23,14 +23,14 @@ def generate_contents(platform="all"):
|
||||
applications = app_data.get("applications", [])
|
||||
|
||||
# Map parent categories id to corresponding name
|
||||
parent_map = {cat["id"]: cat["Name"] for cat in categories}
|
||||
parent_map = {cat["id"]: cat["name"] for cat in categories}
|
||||
|
||||
# Group subcategories by their parent
|
||||
subcat_by_parent = {}
|
||||
for sub in subcategories:
|
||||
parent = sub.get("parent", "other")
|
||||
subcat_by_parent.setdefault(parent, []).append({
|
||||
"Name": sub["Name"],
|
||||
"Name": sub["name"],
|
||||
"id": sub["id"]
|
||||
})
|
||||
# Sort subcategories alphabetically in each parent group
|
||||
|
||||
@@ -12,7 +12,7 @@ def generate_table_of_contents():
|
||||
subcategories = data.get("subcategories", [])
|
||||
|
||||
# Build the alphabetical list (ignoring parent categories)
|
||||
subcat_names = [sub["Name"] for sub in subcategories]
|
||||
subcat_names = [sub["name"] for sub in subcategories]
|
||||
subcat_names.sort(key=lambda x: x.lower())
|
||||
alphabetical_md = ""
|
||||
for name in subcat_names:
|
||||
@@ -20,12 +20,12 @@ def generate_table_of_contents():
|
||||
|
||||
# Build the categorized list
|
||||
# Create a mapping from parent id to parent name
|
||||
parent_map = {cat["id"]: cat["Name"] for cat in categories}
|
||||
parent_map = {cat["id"]: cat["name"] for cat in categories}
|
||||
# Group subcategories by their parent id
|
||||
grouped = {}
|
||||
for sub in subcategories:
|
||||
parent = sub.get("parent", "other")
|
||||
grouped.setdefault(parent, []).append(sub["Name"])
|
||||
grouped.setdefault(parent, []).append(sub["name"])
|
||||
# Sort each group's subcategories alphabetically
|
||||
for key in grouped:
|
||||
grouped[key].sort(key=lambda x: x.lower())
|
||||
|
||||
Reference in New Issue
Block a user