← Back to TIL

Notion supports mermaid diagrams

Github announced a while back that they were adding support for notion diagrams in markdown documents, it's a super handy feature for including diagrams. What I didn't realise at the time is that Notion actually already had support, since December 2021 even. It was a bit of a side note in their release notes so understandable that I and other folks missed it.

You just pop some mermaid code in a code block like so:

erDiagram
    CUSTOMER ||--o{ ORDER : places
    CUSTOMER {
        string name
        string custNumber
        string sector
    }
    ORDER ||--|{ LINE-ITEM : contains
    ORDER {
        int orderNumber
        string deliveryAddress
    }
    LINE-ITEM {
        string productCode
        int quantity
        float pricePerUnit
    }

And notion renders it nicely inline

notion mermaid