Files
endorphin-tabularium-docs/tools/figures/src/endor_figures/cli.py
T
codex-bot 1c27f6bc1e
Verify and deploy Tabularium / verify-and-deploy (push) Successful in 4m14s
Explain Endor concepts with a reproducible multi-region topology
2026-10-27 17:45:30 +08:00

39 lines
1.8 KiB
Python

"""Generate local SVG assets without external fonts or rendering services."""
from pathlib import Path
import drawsvg as draw
from .architecture import build_architecture
def main() -> None:
root = Path(__file__).resolve().parents[4]
output = root / "apps/docs/public/figures/workflow.svg"
output.parent.mkdir(parents=True, exist_ok=True)
diagram = draw.Drawing(960, 240)
diagram.append_title("Local figure workflow")
diagram.append(draw.Rectangle(0, 0, 960, 240, fill="#f5f5f0", rx=16))
diagram.append(draw.Text("TABULARIUM / FIGURE WORKFLOW", 16, 32, 42,
fill="#57534e", font_family="sans-serif"))
for index, (title, subtitle) in enumerate([
("Python source", "tools/figures"),
("SVG asset", "apps/docs/public/figures"),
("Local documentation", "content/docs"),
]):
x = 32 + index * 312
diagram.append(draw.Rectangle(x, 80, 272, 120, rx=12,
fill="#ffffff", stroke="#a8a29e"))
diagram.append(draw.Text(title, 20, x + 18, 126,
fill="#134e4a", font_family="sans-serif"))
diagram.append(draw.Text(subtitle, 14, x + 18, 164,
fill="#57534e", font_family="monospace"))
if index < 2:
diagram.append(draw.Line(x + 280, 140, x + 302, 140,
stroke="#0f766e", stroke_width=2))
diagram.append(draw.Lines(x + 297, 135, x + 302, 140,
x + 297, 145, fill="none",
stroke="#0f766e", stroke_width=2))
diagram.save_svg(str(output))
print(f"Generated {output.relative_to(root)}")
topology = output.parent / "endor-architecture.svg"
build_architecture(topology)
print(f"Generated {topology.relative_to(root)}")