#!/usr/bin/env python3 """Generate viz/manual.html — the polished standalone user manual — from the in-app grimoire in viz/index.html (the single source of truth per CLAUDE.md). Re-run whenever the grimoire changes: python3 build_manual.py ponytail: string-slice extraction, no HTML parser dep. The grimoire is a flat, well-formed block; if its shape ever changes, this fails loudly (asserts) rather than emitting a broken page. """ import re import sys import pathlib HERE = pathlib.Path(__file__).parent SRC = HERE / "viz" / "index.html" OUT = HERE / "viz" / "manual.html" html = SRC.read_text(encoding="utf-8") # --- 1. the whole ", html, re.S) assert m, "no
{grim.replace('