Really simple example of using C to write typst plugins using the wasm-minimal-protocol.
No emscripten required! Requirements:
- clang
- typst compiler
You can run the following commands to compile plug.c and plug.typ:
clang --target=wasm32 --no-standard-libraries -Wl,--export-all -Wl,--allow-undefined -Wl,--no-entry -o plug.wasm plug.ctypst compile plug.typYou may also find the commands inside of build.sh.