49 lines
2.2 KiB
Python
49 lines
2.2 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
|
|
from .deployment import build_deployment
|
|
from .purpose import build_purpose
|
|
|
|
|
|
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)}")
|
|
|
|
deployment = output.parent / "endor-deployment.svg"
|
|
build_deployment(deployment)
|
|
print(f"Generated {deployment.relative_to(root)}")
|
|
|
|
purpose = output.parent / "endor-purpose.svg"
|
|
build_purpose(purpose)
|
|
print(f"Generated {purpose.relative_to(root)}")
|