For AI agents: the complete documentation index is available at https://lazygophers.github.io/pamphlet/en/llms.txt, the full documentation bundle is available at https://lazygophers.github.io/pamphlet/en/llms-full.txt, and this page is available as Markdown at https://lazygophers.github.io/pamphlet/en/write/diagrams/others.md.

The other seven engines

Mermaid ships inside Pamphlet. The other seven are each their own package — install the one you need. Everyone else downloads nothing: all seven together weigh about 340MB, and d2 alone is 91.4MB.

Fence languageEngineInstallSize
dotGraphviznpm i -D @nekoleapuki/pamphlet-engine-graphviz2.1MB
mathMathJaxnpm i -D @nekoleapuki/pamphlet-engine-mathjax50MB
vega-liteVega-Litenpm i -D @nekoleapuki/pamphlet-engine-vega-lite26MB
wavedromWaveDromnpm i -D @nekoleapuki/pamphlet-engine-wavedrom3.3MB
bytefieldbytefield-svgnpm i -D @nekoleapuki/pamphlet-engine-bytefield2.1MB
d2d2npm i -D @nekoleapuki/pamphlet-engine-d291.4MB
plantumlPlantUMLnpm i -D @nekoleapuki/pamphlet-engine-plantumljar + Java

Each has its own page — follow the first column: what it is, what it draws, how the fence looks, and what the traps are.

Using a fence without its engine reports DIAG-301 and fails the whole build (no placeholder box), with the command from the third column in the hint. pamphlet doctor lists all seven at once.

Why not just bundle them all

Installing @nekoleapuki/pamphlet-cli gives you the compiler only, with no engine attached.

That is not laziness, it is arithmetic: all the engines together weigh about 340MB. Measured (npm install of six engines plus du -sh node_modules): 270 packages, 189MB, plus Playwright and Chromium at about 150MB.

For a Markdown tool that is an adoption killer. Optional dependencies put the weight exactly on the people who use that engine — a text-only user installs none of them.

Maths is block-level only

```math
E = mc^2
```

$E=mc^2$ inline is not supported.

$ is everywhere in technical writing — $ npm install, $HOME, $99. Supporting it would require conflict detection and escaping rules, and a false positive turns ordinary prose into a formula.

Even a single symbol has to be a block fence; or use raw HTML <sub> / <sup> (raw HTML passes through).

Incidentally the maths engine will be MathJax v3 rather than KaTeX: KaTeX emits HTML+CSS rather than SVG by default (https://katex.org/), which does not suit a "pre-render to inline SVG" pipeline.

PlantUML needs Java

Of the seven it is the only one requiring Java ≥ 11. That cost is accepted knowingly — it is the only engine that would add advanced UML and real C4 modelling.

So Java is a documented optional prerequisite, not a hidden requirement. pamphlet doctor will check java -version and give a clear diagnostic when it is missing, rather than letting a raw spawn failure surface.

Libraries, never CLI packages

Measurement showed that of those 189MB, about 38MB is raster-output dependencies — and Pamphlet only needs SVG:

  • vega-cli drags in canvas at 19MB (a native module needing local compilation, the kind that most often fails to install in CI)
  • wavedrom-cli drags in @jimp / gifwrap / @resvg, about 19MB

Using the vega + vega-lite libraries (view.toSVG()) and the wavedrom library itself removes all 38MB.

Bringing your own engine

Describe an external command in the engines frontmatter field — source in on stdin, SVG out on stdout:

engines:
  my-engine:
    langs: [mylang]
    command: [my-renderer, --svg, -]

No JavaScript from you means no third-party code at build time. See Adding a custom diagram engine.

Sources: ADR-0048, ADR-0008