Documentation

CleanMermaid adds the Export-Safe Mermaid Diagram macro to Confluence Cloud.

1. Insert a Diagram

  1. Open any Confluence Cloud page in edit mode.
  2. Type /mermaid and select Export-Safe Mermaid Diagram.
  3. Pick a starter template (Flowchart, Sequence, Gantt, or ER Diagram) or paste your Mermaid syntax (Tab indents; Ctrl/Cmd+S saves).
  4. Choose Print-Neutral Light (recommended for PDF/Word) or Confluence Auto (Light/Dark).
  5. Click Save Diagram. CleanMermaid stores your Mermaid source alongside a bounded (≤ 140 KiB) PNG snapshot in macro config.

2. Export to PDF or Word (and Large-Page Limits)

When you export a page to PDF or Word, Confluence invokes the app's native adfExport function, embedding the pre-rendered snapshot scaled to portrait page width. For exceptionally dense diagrams (> 140 KiB PNG), the snapshot is omitted so your Mermaid source still saves cleanly, and PDF/Word falls back to native/code rendering. Note: Confluence Cloud pages with roughly 100 or more Forge macros may encounter platform export rate limits (CONFCLOUD-82734).

3. Example Mermaid Snippet

flowchart LR
  A[Author Diagram] --> B[2x PNG Snapshot]
  B --> C[Confluence View]
  B --> D[Crisp PDF & Word Export]

4. Troubleshooting & Migration Guides