Mermaid markers
sysgraph keeps catalog, role, endpoint, decision and flow links in %% lines, which Mermaid ignores as comments. A flow therefore opens unchanged in any Mermaid tool, and in sysgraph it comes with all its links. You never have to write these markers yourself — the editor produces them — but knowing what they mean helps when you work in the code view.
Participants
Written right above the participant definition:
| Marker | Meaning |
|---|---|
%% @item <id> | Links the participant to a catalog item. An item of another workspace is written <id>@<workspace>. |
%% @role <id> | The participant's role (appearance). |
%% @color #hex | The participant's color. |
%% @item pay
%% @role svc
%% @color #2fbf7f
participant P as Payment ServiceThe participant type uses Mermaid's own syntax: participant DB@{ "type": "database" } as Order DB.
Messages
Written right above the message:
| Marker | Meaning |
|---|---|
%% @ep <id> | Links the message to an endpoint; the message text starts with the endpoint label (e.g. POST /orders). |
%% @tone success|error|warning|info | Colors the arrow and text. |
Notes
Written right above the note:
| Marker | Meaning |
|---|---|
%% @ref <flow> | Links the note to another flow (a reference). The expand suffix shows it expanded in the preview. |
%% @adr <decision> | Links the note to an architecture decision. |
Blocks and activation
| Marker | Meaning |
|---|---|
%% @color #hex (above a block) | The block's color. |
%% @auto | The activate / deactivate lines that follow are fixes produced by auto activation. |
Portable definitions
So that links aren't lost when a flow is copied into another workspace or tool, sysgraph writes the definitions into the flow when needed:
| Marker | Meaning |
|---|---|
%% @roledef <id> {json} | A role's definition. |
%% @itemdef <id> {json} | A catalog item's definition. |
%% @epdef <id> {json} | An endpoint's definition. |
Mermaid doesn't see these lines. When you open the flow in GitHub or Notion the diagram is drawn exactly the same; only the sysgraph-specific links go unused there.