build.py
At 6aac89aCopy the commit ID
Preview
Code812 Bfrom pathlib import Path
import shutil
import subprocess
from source.logo import render
root = Path(__file__).resolve().parent
art = root / "art"
art.mkdir(exist_ok=True)
previews = root / "previews"
previews.mkdir(exist_ok=True)
renderer = shutil.which("rsvg-convert")
for name, grid in [("logo-grid", True), ("logo-clean", False)]:
svg = art / (name + ".svg")
svg.write_text(render(grid=grid))
if renderer:
subprocess.run([renderer, "-w", "1000", "-h", "1000", "-o", str(previews / (name + ".png")), str(svg)], check=True)
if renderer is None:
raise SystemExit("SVGs are in art/. Install librsvg, then run build.py again to render PNGs.")
shutil.copy2(previews / "logo-grid.png", root / "cover.png")
print("Built grid and clean logos as SVG and PNG, with the grid logo as cover.png.")