')
for slot, source, source_id, blurb in items:
vpath = vendor_path(slot, source, source_id)
if source == "tabler":
normalize = normalize_tabler
attribution = f"Tabler Icons / `{source_id}` (MIT)"
elif source == "simple":
normalize = normalize_simple
attribution = f"Simple Icons / `{source_id}` (CC0)"
elif source == "logz":
normalize = normalize_logz
attribution = f"log-z/logos / `{source_id}` (MIT)"
elif source.startswith("devicon"):
variant = source.split(":")[1] if ":" in source else "plain"
normalize = normalize_devicon
attribution = f"Devicon / `{source_id}-{variant}` (MIT)"
elif source == "url":
normalize = normalize_url
domain = re.sub(r"https?://([^/]+)/.*", r"\1", source_id)
attribution = f"Direct fetch / `{domain}` — verify license before use"
else:
raise ValueError(f"unknown source: {source}")
if vpath.exists():
print(f" local {source}/{source_id} -> {slot}", file=sys.stderr)
raw = vpath.read_text(encoding="utf-8")
else:
print(f" fetching {source}/{source_id} -> {slot}", file=sys.stderr)
if source == "tabler":
raw = fetch_tabler(source_id)
elif source == "simple":
raw = fetch_simple(source_id)
elif source == "logz":
raw = fetch_logz(source_id)
elif source.startswith("devicon"):
variant = source.split(":")[1] if ":" in source else "plain"
raw = fetch_devicon(source_id, variant)
elif source == "url":
raw = fetch_url(source_id)
if raw is not None:
vpath.parent.mkdir(parents=True, exist_ok=True)
vpath.write_text(raw, encoding="utf-8")
if raw is None:
misses.append(f"{slot} <- {source}/{source_id}")
md_chunks.append(
f"### {slot}\n_NOT FOUND — please pick a fallback_\n\n"
)
gallery_chunks.append(
f'
'
)
continue
try:
snippet = normalize(raw)
except ValueError as e:
misses.append(f"{slot} <- {source}/{source_id} (parse: {e})")
continue
md_chunks.append(
f"### {slot}\n{blurb}\n\n"
f"```svg\n{snippet}\n```\n\n"
f"Source: {attribution}\n\n"
)
gallery_chunks.append(
f'
'
)
gallery_chunks.append("