The IR supersedes both intermediate designs (requirements D6, D7):
station/tools/docgen and the graph model that briefly lived in graphgen.
Shipping them beside atlas2/docgen would mean two graph models, which is the
thing the architecture argues against.
Carried across rather than lost:
- style/extract.py and tokens.py, the offline theme harvester (R31). Rewritten
to emit a *theme* — a slot-to-hex binding — rather than a whole style file,
since what harvesting recovers is which colour a slot should be, not what a
kind should look like.
- graphgen/README.md, rewritten for what graphgen actually is now: the
schema explorer. It fixes the blank station-index entry at run.py:304.
Two bugs found while doing it:
- Canvas and ink are the two lightness extremes, not the two most common
values. In a Graphviz SVG every label carries a fill, so the ink outnumbers
the canvas 87 to 43 and the old rule produced a theme whose text was
invisible against its own background.
- A name defined in both branches of an if/else produced a duplicate id, which
failed validation on docgen's own source. Disambiguated by line.
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
""" python3 -m docgen.emitters <emitter> <ir.json> [options]"""
|
|
|
|
import sys
|
|
|
|
|
|
def main(argv=None):
|
|
argv = sys.argv[1:] if argv is None else argv
|
|
if not argv:
|
|
print("usage: python3 -m docgen.emitters <auto|dot|index|erd|notebook|site|minimap|explore> <ir.json> [-o OUT] [--style NAME] [--theme NAME]",
|
|
file=sys.stderr)
|
|
return 2
|
|
name, rest = argv[0], argv[1:]
|
|
if name == "dot":
|
|
from .cli_dot import main as run
|
|
elif name == "index":
|
|
from .cli_index import main as run
|
|
elif name == "erd":
|
|
from .cli_erd import main as run
|
|
elif name == "auto":
|
|
from .auto import main as run
|
|
elif name == "notebook":
|
|
from .cli_notebook import main as run
|
|
elif name == "site":
|
|
from .cli_site import main as run
|
|
elif name == "minimap":
|
|
from .cli_minimap import main as run
|
|
elif name == "explore":
|
|
from .cli_explore import main as run
|
|
else:
|
|
print(f"Error: no emitter {name!r} — have: auto, dot, index, erd, notebook, site, minimap, explore", file=sys.stderr)
|
|
return 1
|
|
return run(rest)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|