Diagram Macros for Confluence
Two macros: Mermaid diagram draws flowcharts, sequence diagrams, Gantt charts, class, state and ER diagrams, pie charts, mind maps and more from Mermaid text. Markdown renders Markdown with tables, code blocks, lists and links. Both render in your browser; nothing is sent anywhere.
Getting started
- Install Diagram Macros for Confluence from the Atlassian Marketplace.
- Insert a macro while editing a page: type
/Mermaidor/Markdown, or pick it from the + menu. The editor opens with an example and a live preview. - Write your diagram or text on the left, watch the preview on the right, press Save, then publish the page.
- Edit later by selecting the macro on the page and clicking the pencil.
Mermaid diagram
The macro accepts any diagram the bundled Mermaid version understands: flowchart, sequenceDiagram, gantt, classDiagram, stateDiagram-v2, erDiagram, pie, journey, mindmap, timeline, gitGraph, quadrantChart, xychart-beta, block-beta, sankey-beta and C4 diagrams. The Start from list in the editor gives you a working example of the common ones.
| Setting | What it does |
|---|---|
| Theme | default, neutral, dark or forest. "default" follows Confluence's light and dark mode. |
| Width | 10 to 100 percent of the page width; the diagram scales to fit. |
| Align | center, left or right. |
| Caption | Shown under the diagram and included in exports. |
If the text has a mistake, the preview and the page show the line number and what Mermaid expected, with the offending line underneath. Save is disabled until the diagram parses.
Exports: PDF, Word and page history
Confluence exports cannot run a browser, so a diagram needs a picture. Hover over a diagram on a published page and click Save as image to page: the app draws a PNG in your browser and stores it as an attachment on the page (named after the macro). From then on PDF and Word exports and the page history show the picture; the diagram text stays the source of truth. Click again after changing the diagram to refresh the picture. Without a saved image, exports show the Mermaid text in a code block.
Markdown
CommonMark plus tables and automatic links. Raw HTML is shown as text, never rendered. Links open in a new tab; image syntax becomes a link to the image rather than loading it. Exports turn the Markdown into real Confluence content (headings, lists, tables, code).
Where the text lives
The diagram or Markdown text is stored in the page itself, as the macro's configuration, and is indexed by Confluence search. The app keeps no copy of your content anywhere; its storage holds nothing at all. Limit: 50,000 characters per macro.
Frequently asked
Does it load Mermaid from the internet?
No. The Mermaid and Markdown libraries are bundled inside the app and served by Atlassian. The app makes no network calls outside your Atlassian site.
Can I move from another Mermaid macro?
Copy the diagram text into this macro; Mermaid syntax is the same. Automatic migration of other vendors' macros is not possible in Confluence Cloud.
Why does my diagram look different from the editor I used before?
Labels are drawn as SVG text rather than HTML so that saved images are exact. Very long labels wrap differently; use <br/> in Mermaid to break lines.
Guides
- How to make a Gantt chart or sequence diagram in Confluence
- Markdown in Confluence Cloud pages
- Mermaid diagrams in Confluence PDF and Word exports
- How to add Mermaid diagrams in Confluence Cloud
Changelog
- 1.0 (November 2026): first release.
