Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagrams not correctly included with DocumenterVitepress #12

Open
mofeing opened this issue Jan 23, 2025 · 3 comments
Open

Diagrams not correctly included with DocumenterVitepress #12

mofeing opened this issue Jan 23, 2025 · 3 comments

Comments

@mofeing
Copy link
Contributor

mofeing commented Jan 23, 2025

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.

@mortenpi
Copy link
Member

mortenpi commented Jan 24, 2025

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:

struct MermaidScriptBlock <: Documenter.AbstractDocumenterBlock end
function Documenter.HTMLWriter.domify(dctx::DCtx, node::Node, ::MermaidScriptBlock)
DOM.@tags script
script[:type => "module"]("""
import mermaid from '$MERMAID';
mermaid.initialize({
startOnLoad: true,
theme: "neutral"
});
""")
end

@mortenpi mortenpi changed the title Visualization broken on last version Diagrams not correctly included with DocumenterVitepress Jan 24, 2025
@mofeing
Copy link
Contributor Author

mofeing commented Jan 24, 2025

@asinghvi17
Copy link

asinghvi17 commented Jan 24, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants