Evening,
I wanted to be able to include #d2 blocks inside typst. My preference was using TinyGo to produce the stripped WASM it needs. Unfortunately I was not able to get D2 compiled in TinyGo even though I managed to get a JS runtime going in WASM to actually run the elk formatter.
After a lot of wrangling I came to the conclusion that it is probably more productive to create a pre-processor for typst than a plugin.
I have released that and an MCP version for your preferred LLM harness to consume:
https://github.com/dlouwers/typst-d2-mcp
It worked quite well locally running it all kinds of gauntlets and corrections. Would love your feedback.
Best
Dirk
Evening,
I wanted to be able to include #d2 blocks inside typst. My preference was using TinyGo to produce the stripped WASM it needs. Unfortunately I was not able to get D2 compiled in TinyGo even though I managed to get a JS runtime going in WASM to actually run the elk formatter.
After a lot of wrangling I came to the conclusion that it is probably more productive to create a pre-processor for typst than a plugin.
I have released that and an MCP version for your preferred LLM harness to consume:
https://github.com/dlouwers/typst-d2-mcp
It worked quite well locally running it all kinds of gauntlets and corrections. Would love your feedback.
Best
Dirk