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

Dep Update Mermaid 10.3 #5193

Closed
4 tasks done
strausmann opened this issue Mar 13, 2023 · 10 comments
Closed
4 tasks done

Dep Update Mermaid 10.3 #5193

strausmann opened this issue Mar 13, 2023 · 10 comments
Labels
change request Issue requests a new feature or improvement

Comments

@strausmann
Copy link
Sponsor

Context

No response

Description

MkDocs Material use Mermaid 9.3 but 10.x is the latest release. Update required.

Related links

Use Cases

The update has just been released recently and will certainly be of help to other users.

Visuals

No response

Before submitting

@squidfunk
Copy link
Owner

Thanks for suggesting. Mermaid.js 10+ is ESM-only, which is currently not supported by MkDocs. However, since we automatically include it, we are actually able to upgrade. If somebody wants to provide a PR, feel free!

We need to make sure all diagram types still work.

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Mar 13, 2023
@strausmann
Copy link
Sponsor Author

What is ESM ?

@squidfunk
Copy link
Owner

ECMAScript modules. See the v10 release notes.

@squidfunk
Copy link
Owner

Okay, so I've investigated this change request, and I don't think we're ready yet to make the switch. The thing is that Material for MkDocs can't go full-ESM yet, as we need to support older browsers that don't have support for ESM. We would be removing support for those browsers. Now, if you want v10, you can still achieve the same thing via theme extension, but for now we can't make this switch. This is very likely going to change in the future, but currently not planned. Related:

@squidfunk squidfunk closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2023
@samzong
Copy link

samzong commented May 31, 2023

temporary:

follow this document add custom theme override: main.html, apply the content.

{% block scripts %}
  <script type="module">
      import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10.2.0/+esm'
  </script>
{% endblock %}

@squidfunk
Copy link
Owner

@sheilnaik
Copy link

temporary:

follow this document add custom theme override: main.html, apply the content.

{% block scripts %}
  <script type="module">
      import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10.2.0/+esm'
  </script>
{% endblock %}

This definitely feels like a temporary workaround. Using this block removes the search field. Adding {{ super() }} as suggested in the docs brings back the search bar, but also reverts back to the version of Mermaid (version 9.x) included with mkocs-material. It doesn't seem like there's a way to have both.

@squidfunk
Copy link
Owner

We've re-evaluated this request and progress is now tracked in #5758. If somebody is up to it, any help is appreciated. Please see the additional comments in #5758.

@glureau
Copy link

glureau commented Aug 30, 2023

@sheilnaik did you find another workaround?

@sheilnaik
Copy link

@sheilnaik did you find another workaround?

I unfortunately did not. I'm waiting on #5758 and I'm just not using search on my site for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement
Projects
None yet
Development

No branches or pull requests

5 participants