"
f"{len(screen_names)} screens · "
f"{data_carrying} DataCarrying · {data_free} DataFree · "
f"{total_pngs_android} Android PNGs · {total_pngs_ios} iOS PNGs"
f"
\n"
)
f.write("\n")
f.write(
f"
{html.escape(screen)} "
f"{category}"
)
if plats != {"android", "ios"}:
only = "Android" if "android" in plats else "iOS"
f.write(f" {only}-only")
f.write("
\n")
for state_label, suffix in rows_for(category):
key = f"{screen}_{suffix}"
a_rel = android.get(key)
i_rel = ios.get(key)
a_expected = "android" in plats
i_expected = "ios" in plats
a_cell = (
f"
})
"
if a_rel
else placeholder("android", screen, suffix, a_expected)
)
i_cell = (
f"
})
"
if i_rel
else placeholder("ios", screen, suffix, i_expected)
)
f.write(
f"
"
f"
{html.escape(state_label)}
"
f"{a_cell}{i_cell}"
f"
\n"
)
f.write("
\n")
f.write(PAGE_FOOT)
print(
f"wrote {OUT_HTML}: "
f"{len(screen_names)} screens ({data_carrying} DC + {data_free} DF) · "
f"{total_pngs_android} Android · {total_pngs_ios} iOS"
)
def write_markdown(
android: dict[str, str],
ios: dict[str, str],
manifest: list[tuple[str, str, set[str]]],
) -> None:
"""Gitea-renderable grid as markdown tables."""
out = os.path.join(REPO_ROOT, OUT_MD)
os.makedirs(os.path.dirname(out), exist_ok=True)
with open(out, "w", encoding="utf-8") as f:
f.write("# honeyDue parity gallery\n\n")
f.write(
f"*{len(manifest)} screens · {len(android)} Android · {len(ios)} iOS*\n\n"
)
f.write(
"Auto-generated by `scripts/build_parity_gallery.py` — do not hand-edit.\n\n"
)
f.write("See [parity-gallery.md](parity-gallery.md) for the workflow guide.\n\n")
f.write("## Screens\n\n")
for name, category, plats in manifest:
tag = ""
if plats != {"android", "ios"}:
only = "Android" if "android" in plats else "iOS"
tag = f" — *{only}-only*"
f.write(f"- [{name}](#{name.replace('_', '-')}) *({category})*{tag}\n")
f.write("\n---\n\n")
for name, category, plats in manifest:
anchor = name.replace("_", "-")
f.write(f"## {name} *({category})*