Skip to content

Instantly share code, notes, and snippets.

@gulbanana
Last active October 26, 2021 04:28
Show Gist options
  • Save gulbanana/1ce1c52e3a4f91060f209281cb9bfefa to your computer and use it in GitHub Desktop.
Save gulbanana/1ce1c52e3a4f91060f209281cb9bfefa to your computer and use it in GitHub Desktop.
thousand words: syntax overhaul options

A simple flowchart.

class terminal [fill=#8f4]
class choice [shape=rhombus,padding=15 30,fill=#ff7]

group [grid=4 rows, layout=pack, justify=stretch center, gutter=45] {
    object start { label: "Lamp doesn't work"; fill: #f88 }

    line start
      -> |choice "Lamp\nplugged in?"|
      -> |choice "Bulb\nburned out?"|
      -> |terminal "Repair Lamp"|

    line "Lamp\nplugged in?" -> |terminal "Plug in lamp" [row=2]|

    line "Bulb\nburned out?" -> |terminal "Replace bulb"|
}
style Terminal { fill: #8f4 }
style Choice { shape: rhombus; padding=15 30; fill=#ff7 }

Group {
    grid: 4 rows; layout: pack; justify: stretch center; gutter=45

    Object start { label: "Lamp doesn't work"; fill: #f88 }

    Line start
      -> Choice "Lamp\nplugged in?"
      -> Choice "Bulb\nburned out?"
      -> Terminal "Repair Lamp"

    Line "Lamp\nplugged in?" -> Terminal "Plug in lamp" { row: 2 }

    Line "Bulb\nburned out?" -> Terminal "Replace bulb"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment