Fixed backticks still in applications.json platform tags

This commit is contained in:
Lucas
2025-03-22 16:54:04 -07:00
parent c242bc20f3
commit 65a5c66720
10 changed files with 654 additions and 657 deletions

View File

@@ -1,7 +1,7 @@
import json
def slugify(name):
#Create an anchor-friendly slug from a string.
#Create an anchor-friendly slug from a string
return name.lower().replace(" ", "-").replace("(", "").replace(")", "")
def generate_table_of_contents():
@@ -18,15 +18,15 @@ def generate_table_of_contents():
for name in subcat_names:
alphabetical_md += f"- [{name}](#{slugify(name)})\n"
# Build the categorized list.
# Create a mapping from parent id to parent name.
# Build the categorized list
# Create a mapping from parent id to parent name
parent_map = {cat["id"]: cat["Name"] for cat in categories}
# Group subcategories by their parent id.
# Group subcategories by their parent id
grouped = {}
for sub in subcategories:
parent = sub.get("parent", "other")
grouped.setdefault(parent, []).append(sub["Name"])
# Sort each group's subcategories alphabetically.
# Sort each group's subcategories alphabetically
for key in grouped:
grouped[key].sort(key=lambda x: x.lower())
# Sort parent categories (exclude "other", which is appended at the end)
@@ -41,7 +41,7 @@ def generate_table_of_contents():
for subname in grouped[pid]:
categorized_md_lines.append(f" - [{subname}](#{slugify(subname)})")
# Append fixed sections at the end of the categorized TOC.
# Append fixed sections at the end of the categorized TOC
fixed_sections = ["Removed Projects", "FAQ", "Honorable Mentions of Closed-Source Software"]
for item in fixed_sections:
categorized_md_lines.append(f"- [{item}](#{slugify(item)})")