#!/usr/bin/env python3
"""Render one SKiDL block as a schematic SVG (via netlistsvg).

Usage (inside the container):  python3 make_svg.py <block.py> <out_basename>
Runs the block (so its circuit is built, with __file__ set via runpy), then calls
SKiDL generate_svg() on the resulting default circuit.
"""
import sys, runpy, os
from skidl import generate_svg

block, out = sys.argv[1], sys.argv[2]
runpy.run_path(block, run_name="__main__")     # builds default_circuit (also runs its ERC/netlist)
generate_svg(file_=out)                         # netlistsvg -> <out>.svg
print("SVG ->", out + ".svg")
