Skip to content

Instantly share code, notes, and snippets.

@SebastianGrans
Last active March 14, 2023 10:03
Show Gist options
  • Save SebastianGrans/bec65c8b9aba6785f1b2085afdc6a5e5 to your computer and use it in GitHub Desktop.
Save SebastianGrans/bec65c8b9aba6785f1b2085afdc6a5e5 to your computer and use it in GitHub Desktop.
TIL about Mermaid diagrams and that GitHub supports it in Markdown!

Mermaid Diagrams

GitHub supports Mermaid diagrams and renders them directly in Markdown files.

They aren't rendered in the preview tab, so it's best to design them else-where. With mermaid.live, for instance.

Example

Here's a basic example of the syntax and the resulting diagram:

```mermaid
graph TD;
    A[Lunch?]--> B{Is >11:00};
    B-- Yes -->C[Nom nom];
    B-- No -->D[Wait];
    C --> E[Happy!]
    D-->A;
```
graph TD;
    A[Lunch?]--> B{Is >11:00};
    B-- Yes -->C[Nom nom];
    B-- No -->D[Wait];
    C --> E[Happy!]
    D-->A;
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment