badboy / mdbook-mermaid

A preprocessor for mdbook to add mermaid support
Mozilla Public License 2.0
306 stars 32 forks source link

Pre-render the graphs #36

Closed roberth closed 1 year ago

roberth commented 1 year ago

It would be nice to have mdbook-mermaid invoke the renderer ahead of time. Some benefits

I don't know if the mermaid does anything useful that's browser dependent, or whether that'd be important. If it is, the js could still be loaded I presume, but I really don't expect that to be needed.

badboy commented 1 year ago

You can use the mermaid cli to generate svgs or pngs. But I have currently no intention to build it into this tool. If you want though take the code, replace this part with an invocation of the CLI and insert a new image tag (and figure out where to put the image).

roberth commented 1 year ago

That's this part as a permalink for future reference.