-
Notifications
You must be signed in to change notification settings - Fork 25
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
Include local mermaid
library for offline support
#84
Comments
Thank you for your contribution! This is very appreciated. |
Thanks and I can see more or less the requirement but I would need more information. Could you also tell me more about the exact problem you are facing with the current situation, and why an off-line load of the library would be the solution for you? Could I also ask you to provide links for the following statements:
Thanks. |
In my current project/platform we are striving to achieve CI/CD workflow detached from public Internet.
If |
Thanks, it totally makes sense. |
Hi, The issue is that the Mermaid library is fetched from the internet, I would like it to be versioned along the documentation (c.f. @volphy scenario #3). Sources:
|
Thanks. I have re-read documentation and the following trick worked for me:
|
Excellent, and thanks for the additional info. Wouldn't it be better to remove the subdirectories?
Unless you want to keep the various versions? |
I would rather keep versioning information. |
As mentioned in the first message, using I would like the plugin to keep selectively inject the library, but from a local directory. |
Sure. As soon as the library is improved, I will improve my configuration. |
Good. I have created an experimental version 1.0.9 on Github. Example: plugins:
- search
- mermaid2:
javascript: js/mermaid.min.js
It is still possible to use the Note I tested the local version of the Could I ask you to test this and give me your feedback? |
Unfortunately, it does not work in my use case. My steps:
Google Chrome Developer Tools reports the following error on all HTML pages with mermaid diagrams embedded:
Could you test the new feature with MJS files? |
@volphy As mentioned in my message, the recommendation is to use the traditional, all-in-one It is important to distinguish between the if you use a I have never tried to make the ESM library work with mkdocs-mermaid2, but it might be possible. If you have success with that, please let us know the steps. |
You are right. Using the following JavaScript file works: Is it possible to use any version of mermaid JS: If yes, how can I do it? |
Yes, see here, e.g.:
As long as you use a valid version number, it should work (it is not guaranteed that the earliest version of 10 contain that file). The best thing is to check for yourself. |
Looks good, thanks for the work! If it works on your side, could you please release a new version and close this issue? |
It works for me with the file from the following location: Thanks. |
🚀 Published in release 1.1.0 on Pypi. |
Hi,
The documentation states that including a local version of
mermaid
is a hack, but I would like to be able to do it for offline support.I’m assuming that
mermaid
itself doesn’t depend on online resources, but in that case, I’d work on getting them offline as well.It would also be great if the plugin didn’t silently drop libraries that do not contain
\bmermaid\b
in their base name. But I assume this is a requirement of the below point.Instead of relying on
extra_javascript
(which would include the library in all pages, as far as I know), maybe an extra option to themermaid2
plugin section inplugins
could work?Thanks!
The text was updated successfully, but these errors were encountered: