Allow Mermaid diagrams in Suttacentral and Discourse

Mermaid is a diagramming and charting tool that allows diagrams to be drawn using Markdown inspired syntax.

For more information, refer to Mermaid

Github enables mermaid, so it would be nice for this to be available in the main web site and discourse forum as well.

I believe there is a Discourse plugin for mermaid:

Discourse-Mermaid plugin

Adding @musiko to the conversation.

Is this something that would be possible to add?
Any idea of pros and cons?

1 Like

What would be the purpose of the change? What would it accomplish, that was lacking until now?


I believe @christie is referring to the style of posting she’s currently doing on her website:

1 Like

I understand, but what would be an added benefit of enabling this directly on the forum, as opposed to linking to the source?


I would like to be able to embed these diagrams directly in a post, rather than embedding an image, which requires more storage.

Thanks Musiko, good point. The question would be about expected usage in the forum

What are some examples of use cases for these diagrams, please?

Please have a look at this GitHub issue:

As per @sujato’s suggestion, I am experimenting with a way of doing trilinear translation of Pali suttas, combined with grammatical analysis. I am playing with the idea of using pseudo UML diagrams to convey the grammatical analysis. I would like to post such diagrams on Discourse for others to provide feedback. It will be much easier if I can embed the diagrams directly into a post rather than link to a webpage every time. Because then I have to create and publish that webpage first.

If this method proves to be of merit, the next step is I would like to publish these translations on Bilara. If we enable mermaid support in Bilara/suttacentral, then such translations can be published without any further changes to Bilara.


I’m usually reluctant to add extensions (especially third party unmaintained plugins) for maintenance and stability reasons, but in this case you might just be in luck, since there is an official theme component, which I can enable on the fly.

Here are the instructions on how to use the syntax inside the post:

  class `tathāgato bhāsati` {
    english(The Tathāgata speaks)
  class tathāgato {
  class bhāsati {
    3rd person
  `tathāgato bhāsati` *-- tathāgato : agent
  `tathāgato bhāsati` *-- bhāsati : action

flowchart LR
 thank --> you

Awesome, nice additions folks! Mermaid is great, I’ve used it a few times, I had no idea you could add it to Discourse!