This is a terribly barebones and shitty proof-of-concept for writing Ratatui apps for Typst.
Inspired by soviet-matrix
-
Use
ratatypst-corein your Rust project:cargo add --git https://github.com/sermuns/ratatypst
-
Write a Ratatui app (see examples in
examples/) that usesratatypst_core::TypstBackendfor the backend. -
Compile the Rust code, see the
Justfilefor inspiration. Make to usewasm32-unknown-unknowntarget and#importthe.wasmfile as a WASM plugin in your Typst code. -
Render the PDF, either:
-
Edit the
.typfile withtypst-preview.nvimwhich can re-render a preview on every keystroke. -
Use
typstCLI (not as cool)typst watch main.typ
which automatically recompiles PDF everytime the
.typis saved with modifications.
-
This code is 100% certified human-slop. No artificial intelligence was used in the making of this.
