mkdocs: How to signal an incorrect diagram directly into the html page?
See original GitHub issueI am the maintainer of mkdocs-mermaid2, a plugin that displays mermaid diagrams for the mkdocs static web generator. It works well.
But there is a minor inconvenience: currently, it functions like this: an incorrect diagram causes the plugin to fail silently. The HTML page will be displayed as if the diagram did not exist, and this can be confusing.
It would be preferable that the HTML page displayed an error such as Syntax Error, as is the case with the Mermaid live editor (see example in Mermaid live editor)
The full issue is described her: https://github.com/fralau/mkdocs-mermaid2-plugin/issues/1#issue-611696830
Is there someone out there who has sufficient experience with the mermaid javascript library (and possibly a passing familiarity with mkdocs), who could orient us toward a simple and reliable situation?
Hint: we are able pass arguments to the javascript library in this way, from our yaml config file:
plugins:
- mermaid2:
arguments:
securityLevel: 'loose'
theme: dark
But I guess we would have to inject some javascript, right?
Thanks a lot!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top GitHub Comments
Hi! This is a great idea. Just a generic ‘syntax error’ svg to be displayed when synax error is thrown. We should definitely do this.
Thanks a lot! What is the usual procedure? Will the team accept the pull request and immediately release a new version? Or do we wait for a while?
Or should I recommend your version as an alternative?