Closed wbste closed 6 months ago
For posterity, to get MermaidJS to render as a diagram:
Include the mkdocs-exporter.js
file in my docs/assets/scripts
directory
Add the extra_javascript
to mkdocs.yml
(following the example from this repo's mkdocs.yml
extra_javascript:
- assets/scripts/mkdocs-exporter.js
- https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.9.1/mermaid.min.js
Thanks for the great extension!
For posterity, to get MermaidJS to render as a diagram:
- Include the
mkdocs-exporter.js
file in mydocs/assets/scripts
directory- Add the
extra_javascript
tomkdocs.yml
(following the example from this repo'smkdocs.yml
extra_javascript: - assets/scripts/mkdocs-exporter.js - https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.9.1/mermaid.min.js
Thanks for the great extension!
I will make sure to add this to the documentation. Thank you @r-b-g-b!
Thanks @r-b-g-b
I've been trying to work out how to get my MathJax formulas (via arithmatex) to render in the PDF export, and this was the same solution for that.
Hi, I have the same issue. I have coppied the mkdocs-exporter.js into my docs directory and I have the extra_javascript in my yml file. Yet, the diagrams are displayed as code in my pdf. None of the debug options provided anything helpful. Can you please advise what else and how to check? Thank you.
for example, when I try to mangle the script name, to check is the yml script used properly, I get this error: ERROR - [mkdocs-exporter.pdf.browser] (error) RS5 documentation description - RS5 Documentation Failed to load resource: net::ERR_FILE_NOT_FOUND So I guess it shows that the script is located where it should be
Hello @marekzukal,
To help you investigate the problem further, could you please provide a minimal, reproducible example? It would be very helpful if you could either provide a repository or some code snippets.
Thanks,
Thank you, @adrienbrignon, for the quick reply. I cloned the exporter git repository to try out your example config, installed deps into my venv and even in my project the Mermaid diagrams started working. I suspect some package of the dependencies was missing. So definitely a problem on my side. Sorry about that. I am still quite new to the world of python, pip and so on. Pity there was no error message that could point me to the right direction.
just FYI, a list of packages I was missing, probably Cairo is the crucial one.
csscompressor mkdocstrings_python CairoSVG griffe GitPython cairocffi
Does this plugin render mermaid.js correctly?
My PDFs render Mermaid as code, while the website renders the diagram. Docs here: https://squidfunk.github.io/mkdocs-material/reference/diagrams/
Edit: nevermind, you obviously publish mermaid fine: https://adrienbrignon.github.io/mkdocs-exporter/samples/diagrams/