A domain-specific language (DSL) for describing basketball playbooks and generating SVG previews.
- Simple DSL: Human-readable syntax to describe player positions and actions.
- SVG Generation: Generates clean, scalable vector graphics for your playbooks.
- Fast: Built with Rust for high performance and safety.
- Wasm Ready: The core logic is designed to run in both CLI and Web environments.
clone repository
players = { p1, p2, p3, p4, p5 }
state = {
baller = p1,
position = {
p1 = (0, 60),
p2 = (90, -80),
p3 = (-90, -80),
p4 = (50, -10),
p5 = (-50, -10),
},
}
actions = [
action = {
move = {
p5 -> (-20, 40),
},
},
action = {
move = {
p2 ~> (70, 20),
p3 -> (0, -80),
},
screen = {
p4 -> p2:middle,
p5 ~[r]> (-60, -80)
},
pass = {
p1 -> p2:after,
},
}
]
A pre-built CLI is available in the build/ directory.
# Convert a sample playbook to SVG
./build/playbook-cli fixtures/input.playbook --output fixtures/output.svgIf you have Rust and just installed:
# Run all tests
just test
# Convert using cargo
just convert fixtures/input.playbookThis project is licensed under the MIT License - see the LICENSE file for details.