Complete curated-list import automation and vault sync.
Adds list-import tooling, expands romhack-import for PC variants and patch batches, and syncs catalog with 2026-06-23 valhalla placements (Vanguard, Xenoverse, GBA patches, Infinity 3.3.1).
This commit is contained in:
@@ -91,6 +91,12 @@ def types_cell(types):
|
||||
def key(r):
|
||||
return r["stem"].casefold()
|
||||
|
||||
|
||||
def wikilink(stem: str) -> str:
|
||||
"""Obsidian-safe wikilink for note stems that contain [ or ]."""
|
||||
escaped = stem.replace("[", "\\[").replace("]", "\\]")
|
||||
return f"[[{escaped}]]"
|
||||
|
||||
# ---------------------------------------------------------------- MOC config
|
||||
|
||||
# Logical hardware order for human-facing lists.
|
||||
@@ -152,7 +158,7 @@ BASE_MOCS = {
|
||||
def platform_static_table(recs):
|
||||
head = "| Hack | Base | Version | Status | Type |\n|---|---|---|---|---|"
|
||||
rows = [
|
||||
f"| [[{r['stem']}]] | {cell(r['base'])} | {cell(r['version'])} | "
|
||||
f"| {wikilink(r['stem'])} | {cell(r['base'])} | {cell(r['version'])} | "
|
||||
f"{cell(r['status'])} | {types_cell(r['type'])} |"
|
||||
for r in sorted(recs, key=key)
|
||||
]
|
||||
@@ -162,14 +168,14 @@ def base_static_table(recs, with_base):
|
||||
if with_base:
|
||||
head = "| Hack | Base | Version | Dev | Engine | Type |\n|---|---|---|---|---|---|"
|
||||
rows = [
|
||||
f"| [[{r['stem']}]] | {cell(r['base'])} | {cell(r['version'])} | "
|
||||
f"| {wikilink(r['stem'])} | {cell(r['base'])} | {cell(r['version'])} | "
|
||||
f"{cell(r['status'])} | {cell(r['engine'])} | {types_cell(r['type'])} |"
|
||||
for r in sorted(recs, key=key)
|
||||
]
|
||||
else:
|
||||
head = "| Hack | Version | Dev | Engine | Type |\n|---|---|---|---|---|"
|
||||
rows = [
|
||||
f"| [[{r['stem']}]] | {cell(r['version'])} | {cell(r['status'])} | "
|
||||
f"| {wikilink(r['stem'])} | {cell(r['version'])} | {cell(r['status'])} | "
|
||||
f"{cell(r['engine'])} | {types_cell(r['type'])} |"
|
||||
for r in sorted(recs, key=key)
|
||||
]
|
||||
@@ -236,7 +242,7 @@ def index_directory_table(recs):
|
||||
"|---|---|---|---|---|---|")
|
||||
order = {p: i for i, p in enumerate(PLATFORM_ORDER)}
|
||||
rows = [
|
||||
f"| [[{r['stem']}]] | {cell(r['platform'])} | {cell(r['base'])} | "
|
||||
f"| {wikilink(r['stem'])} | {cell(r['platform'])} | {cell(r['base'])} | "
|
||||
f"{cell(r['version'])} | {cell(r['status'])} | {types_cell(r['type'])} |"
|
||||
for r in sorted(recs, key=lambda r: (order.get(r["platform"], 99), key(r)))
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user