squidfunk / mkdocs-material

Documentation that simply works
https://squidfunk.github.io/mkdocs-material/
MIT License
18.65k stars 3.35k forks source link

mermaid version/feature support #7149

Closed PlasmaHH closed 4 weeks ago

PlasmaHH commented 4 weeks ago

Context

No response

Description

There are currently two main things with the built in mermaid support that bother me a bit and could be improved:

I am not really sure how to best solve the zenuml point. One could surely add it to material and have a configuration there that enables/disables it, however I wonder if that is future safe; maybe one could have an option that completely disables the emission of the mermaid javascript import, and then one can do it on its own with the code snippet from their website (it seems you have to have the module object that is actually being used there )

Related links

Use Cases

mermaid gets a new feature and one wants to test/use it

Visuals

No response

Before submitting

squidfunk commented 4 weeks ago

Thank for suggesting. Exact duplicate of https://github.com/squidfunk/mkdocs-material/issues/3171. Closing a duplicate.

squidfunk commented 4 weeks ago

As an addendum: we'll reconsider how to better integrate with third party JavaScript libraries in the future. Currently, MkDocs isn't really built for this. We could cram everything into config.extra, but that doesn't provide any safety or validation, so we'll need to find better approaches.

PlasmaHH commented 4 weeks ago

Note quite sure what I should take from that linked issue (especially since I cannot see the linked commits to understand what the changes were). When adding https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs to extra_javascript it will somehow load 10.9.0 and 10.7.0 at the same time but picking up 10.7.0 for the mermaid code blocks.

Changing the 10.7.0 to 10.9.0 in bundle.dd8806f2.min.js will make the new block-beta work by loading 10.9.0 a second time but so far I found no way I could load it together with zenuml ( first idea was to create an own .mjs that executes the loading code from the zenuml documentation, but even though that runs it seems there is always the material version being picked up to be called )

squidfunk commented 4 weeks ago

Note quite sure what I should take from that linked issue (especially since I cannot see the linked commits to understand what the changes were). When adding https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs to extra_javascript it will somehow load 10.9.0 and 10.7.0 at the same time but picking up 10.7.0 for the mermaid code blocks.

You know what, let's do that and stick to the latest major version. That should at least fix part of the problem. I've generalized the version range in 75d87eaf7.