@choo-choo/astro
v0.1.3
Published
Astro binding for choo-choo: the <ChooChoo> .astro component, SSR-only.
Maintainers
Readme
@choo-choo/astro
Astro binding for Choo Choo: a <ChooChoo> .astro component that renders a railroad diagram from a grammar source or a pre-built IR. Server-rendered at build time — no client-side JavaScript is shipped.
Install
npm install @choo-choo/astroPlus one grammar parser of your choice if you want to pass a source:
npm install @choo-choo/parser-ebnfExample
---
import ChooChoo from "@choo-choo/astro";
import { ebnfParser } from "@choo-choo/parser-ebnf";
const source = `
digit = "0" | "1" ;
pair = digit , digit ;
`;
---
<ChooChoo source={source} parser={ebnfParser} rule="pair" />You can also skip the parser and pass a pre-built IR via the ir prop — handy if you construct diagrams with @choo-choo/core's builder API.
Learn more
License
MIT
