How to install Mermaid to render flowcharts in markdown?

Unfortunately, github-flavoured markdown doesn't support rendering of mermaid graphs. See this issue for more information and finding comfort in other peoples quest of this feature ;)

If your are using VS Code, you can use this extension to preview your mermaid code blocks inside markdown but note that this does not render once you put it on github. To include the chart on github you will have to render it to a file, though someone suggested somehow using the online mermaid editor to render it and retrieve an URL to a rendered version.

Actually, let me try to insert the example chart from the link on the previousely mentioned page... and, no. We get a Failed to upload image; the format is not supported-error.

So you will need to save it as an image first.


I created a Firefox & Chrome extension that wasn't available at the time of the first answer: Github + Mermaid

To use it you will need to specify mermaid as a language:

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```

This works on:

  • PR and issues
  • Comments
  • Gists

(both on preview and save)

PS: I'm not sure whether it's right or not to advertise my own work here, but I feel it answers the questions.