Forum tooling suggestion: Mermaid diagram support for technical posts

Hi everyone,

A small forum tooling suggestion: would it be worth considering Mermaid diagram support on Nervos Talk?

From what I can see, many technical posts, especially around protocol flows, transaction construction, contract architecture, channel state transitions, or developer tooling, would benefit from small diagrams. They can make the underlying idea much easier to follow.

At the moment, the usual workaround is to export Mermaid diagrams as images and upload them as attachments. That works, but it has a few drawbacks:

  • diagrams become harder to edit after feedback, and small corrections require generating and uploading a new image;
  • reviewers cannot easily copy, inspect, or suggest changes to the diagram source;
  • the forum accumulates extra image attachments for things that are fundamentally text-based.

If Mermaid were supported, authors could keep diagrams as plain text in the post. That would make technical explanations easier to maintain and review, and probably lighter for diagram-heavy posts.

Of course, this may or may not be practical within the current Discourse setup.

Curious whether others would find this useful as well.

8 Likes

A useful follow-up here: Discourse already maintains an official Mermaid theme component:

It supports Mermaid code fences directly in posts, composer preview, dark-mode rendering, fullscreen viewing, and controlled syntax errors. The diagrams are rendered client-side from the textual source, so there is no external rendering service or image-upload workflow involved.

This means the proposal may not require much custom development.

2 Likes