DEV Community


Posted on • Updated on

Mermaid snippet

Mermaid is a diagram creation tool built in the Github. You can create a diagram by typing '''mermaid''' on a markdown file (You have to replace quotes with back quotes actually).
Here a sequence diagram snippet being referred as a sample.

    %% Participants
    participant A as Alice
    participant B as Bob
    link A: Go to Wiki @

    %% Main loop
    autonumber %% Turn on sequence numbers on arrows
    loop Every minute
        opt A is ready
            A->>+B: OK?
        note left of A: Note for Alice
        note right of B: Note for Bob
        alt B is ready
            B-->>A: Yes
        else B is not ready
            B-->>-A: No
        note over A,B: Note for both
Enter fullscreen mode Exit fullscreen mode

To render the sequence diagram you wrote at Intellij, enable "mermaid" markdown extension:

Image description

Top comments (0)