
Documentation
Markdown Macro+ for ConfluenceBrowse
Documentation
Markdown Macro+ for ConfluenceMermaid Diagrams
Markdown Macro+ for Confluence renders Mermaid diagrams. You write the diagram as text inside your Markdown, and the macro draws it in the preview and on the published page. The diagram source stays in the macro, so anyone who can edit the page can change it later.
Add a diagram
- Type
/markdownon a Confluence page and insert Markdown Macro+. - In the left pane, start a fenced code block with
mermaidas the language. - Write the diagram, close the block, and check the preview on the right.
- Save the macro, then publish the page.
```mermaid
flowchart LR
A[Pull request] --> B{Tests pass?}
B -- Yes --> C[Merge]
B -- No --> D[Fix and push]
D --> B
```
Sequence diagram
```mermaid
sequenceDiagram
participant User
participant API
participant DB
User->>API: POST /orders
API->>DB: Insert order
DB-->>API: Order ID
API-->>User: 201 Created
```
While the diagram library loads, the macro shows "Drawing diagram". If a diagram has a syntax error, the preview shows "Diagram could not be drawn." with the error, so you can fix it before saving. For security, click handlers and HTML labels in diagrams don't run.
In PDF and Word exports, a diagram is exported as its Mermaid source in a code block.
Mix diagrams with the rest of your Markdown
A diagram is one block in the page, so it sits next to headings, tables, code blocks and math. A runbook can open with a flowchart of the process and follow it with the commands for each step.
Syntax
Diagrams use standard Mermaid syntax. The Mermaid documentation lists every diagram type and option. Check new diagrams in the preview pane before you save.
Tips
- Keep one diagram per code block.
- Use short node labels and put the detail in the text around the diagram.
LR(left to right) suits wide pages;TD(top down) suits long processes.- Paste diagrams from a repository README as they are: the same
```mermaidblock works here.
Importing Markdown files with diagrams
To bring whole Markdown files into Confluence, use Markdown Importer for Confluence and set its Mermaid diagrams option to Render with Markdown Macro+. Each mermaid code block in the imported files becomes a Markdown Macro+ macro that draws the diagram. See Mermaid diagrams in the importer docs.
Guides for Markdown Macro+ for Confluence
Stuck on something this page does not cover? Ask the developers.