initial commit

This commit is contained in:
2025-03-31 11:36:57 +02:00
commit b37186110d
3 changed files with 37 additions and 0 deletions

16
README.md Normal file
View File

@@ -0,0 +1,16 @@
# typst-plugin-compiler
This repository provides a simple docker image to easily compile Typst WASM plugins using EMCC and wasi-stub
The wasi-stub executable is taken from the [wasm-minimal-protocol repo](https://github.com/astrale-sharp/wasm-minimal-protocol).
## Compiling a plugin
1. Write your C plugin. You can start from the example provided in the [wasm-minimal-protocol repo](https://github.com/astrale-sharp/wasm-minimal-protocol).
2. Run the docker image:
```bash
docker run --rm -v $(pwd):/src git.kb28.ch/hel/typst-plugin-compiler:latest compile plugin.c
```
3. Copy the output file (for the above example, `plugin.wasm`) to your Typst project