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 Diagram Offline/Privacy Path Error #3742
Comments
Thanks for reporting - does the following file exist after you’ve built the site?
I’m currently on vacation, which means I don’t have a development environment at my disposal - I’ll check it as soon as I get back. |
This is available:
Here is the whole folder.
|
So this turns out to be trickier than I thought, as it's a combination of things that lead to the observed behavior. What happens:
This also leads to a (temporary?) mitigation: if you add the script explicitly in extra_javascript:
- https://unpkg.com/mermaid@8.13.3/dist/mermaid.min.js I'm pretty sure that nested scripts will not work together with the offline plugin, but I have yet to investigate. I just wanted to provide a way of mitigating the issue at hand for you asap, so your build works again. Unfortunately, we can't just scan for nested scripts and add them to |
Maybe I am misusing the combination of the privacy and offline plugins? I am trying to build to host on a private site which requires the documentation to be built for offline. In addition I build it so it can be downloaded for offline usage since my customers require offline access (plus everything loads faster). |
No, your use case should be perfectly fine, you just hit another yet unknown limitation which I need to investigate and document. It's fixable with a little manual work, as noted in my last comment. If you're building your docs for online and offline usage, I recommend splitting the |
Fixed in If You can either remove the fix in #3742 (comment) or keep it – the plugin should now handle both cases. This is only relevant for the privacy plugin. It's a special case that is necessary as Material for MkDocs automatically mounts |
Released as part of 8.2.8+insiders-4.12.0. |
When site_url isn't set (or is falsey) the privacy plugin will include mermaid.js on _every page_ to mitigate an issue with offline site generation. squidfunk/mkdocs-material#3742
Contribution guidelines
I've found a bug and checked that ...
mkdocs
orreadthedocs
themescustom_dir
,extra_javascript
andextra_css
Description
There appears to be an issue with the Mermaid resources used with the Offline and Privacy plugins. This causes the mermaid diagrams to not be rendered when running the
mkdocs build
command.Here is the error from the console.
Expected behaviour
Mermaid diagrams should render as expected.
Actual behaviour
Mermaid diagrams are not correctly rendered and just display the actual diagram text.
Steps to reproduce
mkdocs -build
Package versions
Python 3.10.0
mkdocs, version 1.2.3
Version: 8.2.5+insiders.4.11.0
Configuration
System information
The text was updated successfully, but these errors were encountered: