beet icon indicating copy to clipboard operation
beet copied to clipboard

Mermaid support

Open mrchantey opened this issue 5 months ago • 2 comments

Maybe we can look into something like mdbook-mermaid although i think that performs the conversion at runtime with js, itd be better to have a build time solution.

mrchantey avatar Jul 20 '25 00:07 mrchantey

There is also simple_mermaid and some other mermaid-related crates, but as far as I can tell they also just uses the the mermaid js library underneath and don't attempt to rewrite it in Rust. Unfortunately I think there is no proper Rust implementation of mermaid.

Maybe you can just use mermaid-rs on your build step, if you can live with it. It goes to the absurd of literally running headless Chrome in order to run mermaidjs and get a SVG out of Chrome's hands, maybe you can have a lighter environment by running mermaid on node or deno or bun or something else.

dlight avatar Jul 21 '25 15:07 dlight

maybe you can have a lighter environment by running mermaid on node or deno or bun or something else.

Awesome thanks yes it looks like server-side mermaid is not yet possible without a browser. js for now then :) might be possible to do something clever with jsdom or servo down the track.

mrchantey avatar Jul 22 '25 04:07 mrchantey