Skip to main content

Bring your existing Mermaid diagrams

Move the Mermaid diagrams you already have, in GitHub READMEs, Markdown files, Mermaid Live or pasted code blocks, into Confluence and Jira without retyping them.

Problem: Your team writes Mermaid in repositories and on mermaid.live. In Confluence and Jira it shows up as code, or as screenshots that are out of date.

Solution: Import the files and links into the diagram editor, and let the app draw the Mermaid code blocks that are already on your pages and work items.

What you'll need​

  • Mermaid Diagrams installed for the product you use. See Get started.
  • Permission to edit the page, or the Edit work items permission in the Jira space.

Choose the right way in​

Your diagrams are…Do thisResult
In a README.md or another Markdown fileImport the fileEach ```mermaid block becomes a diagram in a macro or panel
In .mmd or .mermaid filesImport the fileThe diagram is added to a macro or panel
On mermaid.liveImport the edit or view linkThe diagram is added to a macro or panel
Code blocks on a Confluence pageTurn them into macrosThe page shows diagrams instead of code
Code blocks in a Jira description or commentEdit them in placeThe code block stays, and the app draws it

Import a README into Confluence​

  1. Open the page where the diagrams belong. Add a Mermaid Diagram macro and select Create diagram.

  2. Under Start your diagram, select Import.

  3. Drop the README.md file, or select Choose a file. The dialog lists each Mermaid diagram in the file with the heading it's under.

    The Import diagrams dialog listing two diagrams found in a README file, with a preview

  4. Clear any diagram you don't want, then select Add 2 diagrams.

  5. Select Save and close, then publish the page.

Result: The macro holds one diagram per Mermaid block, and readers page through them. Code blocks in other languages, such as Bash, are skipped.

Check that it works​

  1. Compare a diagram on the page with the same code on mermaid.live. The app uses Mermaid 12.1, like mermaid.live, so they look the same.
  2. If a diagram looks different from an older screenshot, the difference comes from Mermaid 12's new default look. See Keep the previous look.