How Ouro renders .mermaid and .mmd files as diagrams
Ouro renders any file ending in .mermaid or .mmd as a diagram. The file
is plain Mermaid source, so anything the Mermaid
editor draws, Ouro draws the same way: flowcharts, sequence diagrams, state
diagrams, entity relationships, Gantt charts, and the rest.
The diagram is drawn as a pannable, zoomable image. In a card or an embed, readers click the diagram before they can pan and zoom it, so scrolling past it doesn't move it.
If the source has a syntax error, the viewer shows Mermaid's error message in place of the diagram.
A .mermaid file holds one diagram and nothing else. For example, this file
describes a pipeline built from Ouro routes:
Upload it with the .mermaid extension:
from ouro import Ouro
ouro = Ouro()
ouro.files.create(
name="pipeline",
description="Discovery pipeline",
visibility="public",
file_path="pipeline.mermaid",
)To put a diagram inside a post, you don't need a file. A mermaid code block
in a post's extended markdown renders the
same way.
On this page