question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mkdocs: How to signal an incorrect diagram directly into the html page?

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
knsvcommented, Jun 6, 2020

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.

0reactions
fralaucommented, Jun 6, 2020

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing Your Docs - MkDocs
Your documentation source should be written as regular Markdown files (see Writing with Markdown below), and placed in the documentation directory.
Read more >
configuring image filepaths correctly in mkdocs - Stack Overflow
I'm using html because I need additional formatting on the images, but the same issue occurs with standard markdown image syntax. Is there ......
Read more >
Reproducible Reports with MkDocs - Tim Vink
In the post Using MkDocs for technical reporting I explained how MkDocs works and why it's a good choice for writing technical reports....
Read more >
Setting up a blog - Material for MkDocs - GitHub Pages
Write your documentation in Markdown and create a professional static site in minutes – searchable, customizable, for all devices.
Read more >
Markdown - abinit
This means that mkdocs creates a directory with an index.html file for each md page included in the ABINIT documentation. For instance, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found