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

Upgrade mermaid.js version and/or make configurable #3171

Closed
4 tasks done
garrettheel opened this issue Nov 3, 2021 · 7 comments
Closed
4 tasks done

Upgrade mermaid.js version and/or make configurable #3171

garrettheel opened this issue Nov 3, 2021 · 7 comments
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open

Comments

@garrettheel
Copy link
Contributor

Contribution guidelines

I want to suggest an idea and checked that ...

  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... the documentation does not mention anything about my idea
  • ... there are no open or closed issues that are related to my idea

Description

Currently https://unpkg.com/mermaid@8.8.4/dist/mermaid.min.js is packaged for mermaid integration, which is almost a year old. This version does not render some graphs correctly, which I see is fixed in later versions (tested with 8.12.0, but not exhaustively).

In addition to a one-time bump, it would also be nice if a path could be provided in mkdocs.yml in order to have finer-grained control over the version and avoid trusting unpkg.com if I want to self-host.

Use Cases

  • Fix bugs in mermaid and enable new features

Screenshots / Mockups

No response

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Nov 3, 2021
@squidfunk
Copy link
Owner

Thanks for reporting. I'll see if we can allow the author to load Mermaid via extra_javascript with Material for MkDocs picking it up, omitting the additional load of the library. That was my initial idea but I haven't implemented it yet.

@squidfunk
Copy link
Owner

squidfunk commented Nov 4, 2021

Fixed in 3235bba1b, which updates Mermaid to 8.13.3, the latest release. Some diagrams look much better indeed. I'll leave this issue open until I had the chance to check if we can let the author provide a specific Mermaid version.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Nov 4, 2021
@garrettheel
Copy link
Contributor Author

thanks @squidfunk!

@squidfunk
Copy link
Owner

I've added support for providing a custom Mermaid.js version in 3bc96001a. Material will now detect when Mermaid is already present and skip its own loading logic. This means you can now provide a custom version via mkdocs.yml:

extra_javascript:
  - https://unpkg.com/mermaid@8.8.0/dist/mermaid.min.js

@squidfunk
Copy link
Owner

Released as part of 7.3.6-insiders-3.2.1.

@alexanderilyin
Copy link

I've added support for providing a custom Mermaid.js version in 3bc96001a. Material will now detect when Mermaid is already present and skip its own loading logic. This means you can now provide a custom version via mkdocs.yml:

extra_javascript:
  - https://unpkg.com/mermaid@8.8.0/dist/mermaid.min.js

Some versions breaking change

Which should be reproduced with:

$ poetry show mkdocs-material
 name         : mkdocs-material                 
 version      : 9.1.21                          
 description  : Documentation that simply works 

dependencies
 - colorama >=0.4
 - jinja2 >=3.0
 - markdown >=3.2
 - mkdocs >=1.5.0
 - mkdocs-material-extensions >=1.1
 - pygments >=2.14
 - pymdown-extensions >=9.9.1
 - regex >=2022.4.24
 - requests >=2.26
extra_javascript:
  - https://unpkg.com/mermaid@10.3.0/dist/mermaid.min.js

@squidfunk
Copy link
Owner

Mermaid 10 currently does not work. It's blocked by #5758.

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 resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

3 participants