Your first diagram
An Inkline diagram is a short text file, usually ending in .ink. The first line names the diagram type; every other line declares a box or connects two boxes.
Write six lines
diagram architecture "Checkout platform"
person shopper "Customer"
service api "Orders API"
store orders "Orders DB"
shopper -> api : HTTPS
api -> orders : SQLdiagram architecture "Checkout platform"picks the type and gives the diagram a title.person shopper "Customer"declares a box: its kind (person), an id you use in arrows (shopper), and an optional label that is drawn.shopper -> api : HTTPSdraws an arrow between two ids, with a label after the colon.
Indentation is only for reading; Inkline ignores it. Lines starting with # are comments.
See it drawn
Paste the text into the playground. The drawing updates as you type and problems are underlined, with a message such as INK2004 api2 is used but never declared. Did you mean api?. Nothing is uploaded: the engine runs in your browser.
Or, with the CLI installed (install guide):
$ ink render checkout.ink -o checkout.png --scale 2
$ ink render checkout.ink -o checkout.svg
The CLI and the playground use the same engine, so both produce the same picture.
Group boxes
zone and group take a block in braces. Boxes declared inside are drawn inside.
diagram architecture "Checkout platform"
direction right
theme slate
person shopper "Customer"
zone aws "AWS eu-west-1" {
service api "Orders API"
store orders "Orders DB"
queue events "Order events"
}
shopper -> api : HTTPS
api -> orders : SQL
api ~> events : publish # ~> is asyncOther diagram types
The same rules work for flowcharts, sequence diagrams and entity-relationship diagrams. Change the first line to diagram flow, diagram sequence or diagram erd and use that type's kinds. The language reference lists every kind, arrow and setting.
Next
- Language reference — every keyword, arrow and diagnostic code.
- CLI reference — render, watch, validate, fmt and convert.
- Export formats — PNG, JPEG, WebP, SVG and PDF options.