Skip to main content

Mermaid code in your content

Many teams already paste Mermaid code into Confluence pages and Jira descriptions, where it shows as plain code. Mermaid Diagrams finds that code and draws it, so readers see the diagram.

Which code is found​

The app looks for code blocks whose first line starts a Mermaid diagram, for example flowchart TD, sequenceDiagram or gantt. It finds them:

  • with the code block language set to mermaid, to another language, or to none;
  • when a --- front matter block or %% comments come before the diagram type;
  • when a ```mermaid fence is typed as plain text rather than in a code block. The app draws those too, but can't change them: edit them in the page or work item itself.

The app ignores code blocks in other languages, such as Python or Bash.

Confluence and Jira work differently​

FeatureConfluenceJira
Where to find itPage β€’β€’β€’ > Apps > Mermaid diagrams on this pageThe Mermaid Diagrams section in the work item's right-hand column, and the panel's Found in this work item list
What changesSelected code blocks become Mermaid Diagram macros, in one new page versionNothing, until you edit a diagram. The code block stays a code block
UndoUndo, until someone else publishes the pageEdit the code block again, or use the work item's history