#pdf #typst #dot #graphics #graph

app clinnet

Incrementally render Typst figures from DOT graphs and assemble them into a grid PDF

9 releases

Uses new Rust 2024

0.1.8 Dec 4, 2025
0.1.7 Dec 4, 2025
0.1.5 Nov 28, 2025

#2593 in Command line utilities

MIT license

225KB
1K SLoC

Rust 1K SLoC // 0.0% comments Typst 149 SLoC // 0.1% comments

clinnet

clinnet is the command-line companion to the linnet graph library. It scans a directory for .dot files, incrementally renders each figure through Typst, and assembles the resulting PDFs into a single grid document.

Installation

cargo install clinnet

This installs the linnet binary (the package is named clinnet to avoid a clash with the library crate). Make sure the typst CLI is available on your $PATH, as the tool shells out to it for every compilation step.

Quick start

# Render every .dot file underneath ./examples into build/grid.pdf
linnet examples

On first run, clinnet writes a small set of default Typst templates and a compiled linnest.wasm plugin into build/templates/. You can provide your own templates via --figure-template, --grid-template, or --layout-template flags. Pass --style multiple times to add extra files whose contents should invalidate the incremental build cache when they change.

You can pass custom variables to Typst templates using --input key=value, which makes the variables available through sys.inputs in your templates. This works exactly like the Typst CLI's --input option.

Typical workflow

  1. Generate or edit .dot graphs in your project directory.
  2. Run linnet <graphs-root> to refresh the figure PDFs and the combined grid.
  3. Open build/grid.pdf (or the path supplied via --grid-output) to browse the results.

The cache lives in build/.cache/figures.json; deleting it forces a full rebuild. See linnet --help for the complete flag list.

Passing variables to templates

You can pass custom variables to your Typst templates:

# Pass variables that will be available in templates via sys.inputs
linnet examples --input theme=dark --input scale=1.5

# Multiple inputs can be specified
linnet examples --input author="John Doe" --input version=1.0 --input debug=true

These variables are available in both figure and grid templates through Typst's sys.inputs dictionary.

Partial rebuilds

After a full run, you can re-render individual figures or the final grid without rescanning DOT files:

# Rebuild a single figure that was part of the previous run
linnet --build-dir build --rebuild-figure path/to/file.dot

# Rebuild the grid PDF based on the cached figure metadata
linnet --build-dir build --rebuild-grid

# Partial rebuilds also support input variables
linnet --build-dir build --input theme=light --rebuild-grid

Dependencies

~9–20MB
~250K SLoC