DocumenterMermaid.jl icon indicating copy to clipboard operation
DocumenterMermaid.jl copied to clipboard

Diagrams not correctly included with DocumenterVitepress

Open mofeing opened this issue 11 months ago • 3 comments

This package is not working for me. Instead I get these text messages in the HTML:

Image

I'm using Julia 1.11.2 with Documenter 1.8.0, DocumenterVitepress 0.1.6.

mofeing avatar Jan 23 '25 15:01 mofeing

DocumenterVitepress 0.1.6

DocumenterMermaid works only with the standard Documenter HTML output. I assume DocumenterVitepress just has a fallback render for unfamiliar blocks.

Maybe @asinghvi17 has some thoughts? Or if there is a Vitepress-compatible approach for mermaid diagrams? I actually think it would be quite reasonable to add DocumenterVitepress support to this package, probably via package extensions. It would need some DocumenterVitepress version of this:

https://github.com/JuliaDocs/DocumenterMermaid.jl/blob/ead5257cea261bab3bb2c64444eb1df786921117/src/DocumenterMermaid.jl#L29-L39

mortenpi avatar Jan 24 '25 06:01 mortenpi

@mortenpi this could be what you're looking for (example for DocumenterCitations.jl)

https://github.com/LuxDL/DocumenterVitepress.jl/blob/822ed6a94404ed9f9f9c224e9c6fbc3c719056d8/ext/DocumenterVitepressDocumenterCitationsExt.jl#L14-L25

mofeing avatar Jan 24 '25 07:01 mofeing

There's a Vitepress plugin for mermaid, so I imagine it shouldn't be hard! We'd just have to add that and define a render function for DocumenterMermaid.MermaidBlock and DocumenterMermaid.MermaidScriptBlock that write those blocks correctly to Markdown.

https://emersonbottero.github.io/vitepress-plugin-mermaid/guide/getting-started.html

asinghvi17 avatar Jan 24 '25 16:01 asinghvi17