Narration / Transcript
Introducing Schemd: a small text-to-SVG compiler for circuits and UML
This is what the narrator says, not what the page shows: equations are read as sentences, code blocks are described, and citations are spoken as citations.
- 0:00
I like diagrams that live close to the code they explain. An exported image is easy to forget, difficult to review, and usually out of date after a few changes.
- 0:11
That is why I built at schemd slash core, a zero-dependency compiler that turns a small text format into accessible SVG.
- 0:20
Schemd currently handles common circuit components, classical and quantum gates, configurable ICs, and the UML diagrams I use most often: class, sequence, state, and use-case diagrams. It runs on the server or during a build, so the browser does not need the compiler or a Markdown package.
- 0:40
A quick example
- 0:42
Install the package: The shell code below is 1 line.
- 0:46
Then compile a diagram: The TypeScript code below is 17 lines.
- 0:51
The result is deterministic inline SVG with a title, description, intrinsic dimensions, and safe text output:
- 1:00
Orthogonal wires avoid component bodies and receive bridge arcs where they cross.
- 1:05
UML uses the same syntax: The code below is 4 lines.
- 1:10
Why another diagram tool?
- 1:13
I wanted a compiler with a narrow job:
- 1:16
no runtime dependencies;
- 1:19
no DOM or browser layout pass;
- 1:22
useful SVG from one function call;
- 1:25
source that is readable in a pull request;
- 1:28
bounded work and predictable output;
- 1:31
enough styling hooks for documentation and simulations.
- 1:36
The compiler entry has a hard 20 KiB gzip budget in CI. The current build is around 18 KiB. Code coverage is also enforced at 100% for statements, branches, functions, and lines.
- 1:51
Schemd does not include a Markdown parser. A host can detect a schemd fence with Marked, markdown-it, unified, or its own parser, then pass only the fence body to core. This keeps the package small and lets each application keep its existing Markdown pipeline.
- 2:09
Try it
- 2:10
The playground compiles on the server and shows the result as you type. The simulation lab uses the optional SVG metadata to connect diagrams to live circuit and quantum examples.
- 2:23
The documentation covers the grammar, components, math labels, output modes, framework adapters, and Markdown integrations. The source is available on GitHub.
- 2:35
A note on scope
- 2:37
Version 0.2.0 is a foundation, not a claim that every engineering or UML notation is already present. Some symbols and diagram semantics are still missing, and dense automatic layout remains hard work. I would rather be clear about that and improve it with real examples than hide the limits behind a broad promise.
- 2:59
Contributions are welcome, especially for missing symbols, adversarial routing cases, UML notation, accessibility, and browser rendering differences. If a change affects the grammar, please open an issue first so we can keep the language coherent and the compiler within its size budget.
- 3:18
I built Schemd for my own technical writing and engineering tools. I hope it also makes your diagrams easier to maintain.