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

mermaid version/feature support #7149

Closed
4 tasks done
PlasmaHH opened this issue May 3, 2024 · 4 comments
Closed
4 tasks done

mermaid version/feature support #7149

PlasmaHH opened this issue May 3, 2024 · 4 comments

Comments

@PlasmaHH
Copy link

PlasmaHH commented May 3, 2024

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:

  • mermaid version is hardcoded (to 10.7.0 currently) and for reasons of less coupling when upgrading it would be useful to make this configurable, this also allows material to update its default version number at their own pace since everyone can always override it
  • mermaid has at least one optional feature, zenuml (https://mermaid.js.org/syntax/zenuml.html) which needs its own extra bit of javascript.

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
Copy link
Owner

Thank for suggesting. Exact duplicate of #3171. Closing a duplicate.

@squidfunk
Copy link
Owner

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
Copy link
Author

PlasmaHH commented May 3, 2024

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
Copy link
Owner

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 75d87ea.

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

2 participants