Mermaid - Generation of diagrams and flowcharts from text in a similar manner as markdown

I agree that curly braces are looking too technical. With tilde fences ~~~, there is also no ambiguity with inline code spans.

Meanwhile, Github has started advertising its Mermaid support in GFM without any special marker like !:

4 Likes

It appears they are rendering it to HTML as a code block literal (i.e. the same as they’d do for ```rust), and the diagram you see in the browser is a client-side Javascript rendering. What you see is dependent on the type of request and whether its from a Javascript-enabled client.

2 Likes

Meanwhile, Github has started advertising its Mermaid support in GFM without any special marker like !

Yeah - that was based off this discussion. You can find details of the implementation here.

While previously I’d been a fan of the ```! syntax to symbolize rendering rather than syntax highlighting, the thing that convinced me was all the prior art without the bang but also we didn’t support nor had any plans to support syntax highlighting of Mermaid script in particular. So the answer to the question of ‘how do I show a block of Mermaid code’ was to do ```.

Possibly pragmatic I know, but as doing it this way didn’t need us to change the CommonMark spec either and the fact it would already work in a bunch of other places (include editor extensions and other hosting services like Discourse, Azure DevOps Wiki’s or GitLab) went ahead and shipped it.

3 Likes

This is an excellent example of how failure to define a standard soon enough will result in a more ad hoc one getting established instead.

4 Likes

This is true statement, but it does not give ideas what can be done now & in future. If you inspect history, existing spec is created from “past info”. And we need to land new extensions (not de-facto standards).

That’s a next spin with new start conditions - not enough prior arts to refer. May be math has chance to be landed. But situation with fenced blocks (literals [diagrams]), fenced containers (markdown [quotes]) and inlines is still uncertain.

3 Likes