summaryrefslogtreecommitdiffstats
path: root/help.txt
blob: 13d0ce47cd6bc24c22aae7b3cdf955ad5f23ad05 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
DESIGN-IT USER MANUAL
=====================

design-it is a fast diagram editor for software architecture: structs,
classes, interfaces, modules, services, storage, state machines and the
relationships between them. It is keyboard first (vim style) but
everything also works with the mouse. Diagrams are plain text files you
can keep in git.

This manual is built into the program. Open it any time with F1 or
:help, jump to a topic with :help <word> (for example :help edges, :help
keys, :help dsl). Scroll with j / k, the mouse wheel, Page Up / Page
Down.

CONTENTS
  1. Getting started
  2. Opening files and drag and drop
  3. The workspace: panels, tabs and views
  4. Modes and the command bar
  5. Canvas: mouse
  6. Canvas: keyboard
  7. Tables: outline, inspector, edges, layers, ...
  8. Panels and tabs: keyboard
  9. Nodes: kinds, sections and members
 10. Edges: kinds, creating, routing, bends
 11. Layout and alignment
 12. Layers and focus mode
 13. Saving and exporting (SVG, PNG, Mermaid, PlantUML)
 14. The .dit.txt text format
 15. Scanning C / C++ code
 16. All commands
 17. Settings and color schemes
 18. Command line options
 19. Platform notes: Windows, macOS, Linux
 20. Troubleshooting
 21. Documentation and source links
 22. Copy and paste
 23. Sequence diagrams
 24. Mermaid and PlantUML


1. GETTING STARTED
------------------

  Start design-it with no arguments and it opens a showcase diagram. To
  start from something else:

    - drag a .dit / .dit.txt / .mmd / .puml file onto the window (see 2)
    - type :open path/to/file.dit.txt and press Enter
    - type :tpl uml (or arch, ecs, microservices, compiler, stress)
    - drag a source folder onto the window to scan its C / C++ headers

  A first diagram in five steps:

    1. press :clear Enter              start empty
    2. move the mouse onto the canvas,
       press a                         add a node, type a name, Enter
    3. press a again somewhere else    a second node
    4. right-drag from one node onto
       the other                       connect them with an edge
    5. :save my_design.dit.txt Enter   save it as text

  Press Escape to cancel anything (typing, a command, a selection).
  Press u to undo and Ctrl+r (or Ctrl+z for undo) to redo.


2. OPENING FILES AND DRAG AND DROP
----------------------------------

  Drag and drop works on every platform:

    - drop a .dit or .dit.txt file on the window: it opens
    - drop a folder: its C / C++ headers are scanned into a diagram (see
      15)
    - drop several files: the first one opens (one diagram at a time)

  Opening replaces the current diagram, but it is undoable: press u to
  get the previous diagram back.

  Other ways to open:

    design-it file.dit.txt         from a terminal
    :open file.dit.txt             from the command bar (Tab completes)
    double click / "Open With"     on macOS with the design-it.app bundle
    drop on the dock icon          macOS, with the design-it.app bundle

  File types:

    .dit.txt   readable text (recommended, diffable, editable by hand)
    .dit       compact binary snapshot, loads instantly, not for editing
    .mmd       Mermaid (class, flowchart, sequence, state, er diagrams)
    .puml      PlantUML (class style and sequence diagrams)

  Mermaid and PlantUML files are converted when they open and laid out
  automatically. :save writes .dit.txt again (see 24).


3. THE WORKSPACE: PANELS, TABS AND VIEWS
----------------------------------------

  The window is split into panels. Each panel holds tabs, each tab shows
  a view. Every view follows the same selection: click a node on the
  canvas and the outline, inspector and edges views jump to it.

  Views (open any with :view <name>):

    canvas      the diagram. Open several, each has its own camera
    outline     tree of modules > nodes > sections > members
    inspector   every property of the selected node or edge, editable
    edges       table of all relationships
    layers      tags with node / edge counts, hide or dim them
    palette     add nodes by kind, load templates
    source      the live .dit.txt text of the diagram
    views       list of every view, Enter opens one
    docs        documentation and source link of the selection (21)
    help        this manual
    appearance, colors, canvas, layout, behaviour, performance, info
                settings groups (see 17)
    frame, memory, heap, arenas, threads, process, gpu, fonts, diagram
                built in profiler

  Mouse:
    drag a tab onto another panel's middle    join that panel's tabs
    drag a tab onto a panel's edge            split the panel
    drag the gap between panels               resize
    middle click a tab                        close it
    double click the empty tab bar            maximize the window
    drag the empty tab bar                    move the window

  :reset puts the default layout back.


4. MODES AND THE COMMAND BAR
----------------------------

  The status bar (bottom left) shows the mode:

    NORMAL    keys are commands (this is where you are most of the time)
    EDIT      you are typing a name, label or value: Enter accepts,
              Escape cancels
    COMMAND   after pressing :  type a command, Tab completes, Enter runs
    SEARCH    after pressing /  type to search, Enter jumps, n / N repeat

  Commands can be shortened to any unique prefix and show completions as
  you type. Section 16 lists all of them.

  Counts: like vim, a number before a key repeats it. 5j moves down five
  rows, 10l pans right ten steps.


5. CANVAS: MOUSE
----------------

  Left click                 select a node or edge
  Shift + left click         add to / remove from the selection
  Left drag on empty space   box select
  Left drag a node           move it (snaps to the grid when snap is on,
                             shows alignment guides)
  Drag the bottom right
  corner of a node           resize it
  Double click a node        rename it
  Double click an edge       edit its label
  Drag a selected edge's     add a bend there (the dots in the middle of
  segment dots               its segments); drag a square to move a bend,
                             double click a square to remove it
  Drag along a lifeline      draw a sequence message (23)
  Click the doc / link mark  in a node header: edit its documentation /
                             open its source link (21)
  Right drag node to node    create an edge (of the current edge tool, e)
  Drag a port dot            create an edge (port dots show on hover)
  Middle drag, or right
  drag on empty space        pan
  Scroll wheel               zoom toward the cursor
  Shift + wheel /
  touchpad sideways          pan horizontally
  Minimap (bottom right)     click or drag to jump around
  [-] / [+] on a header      collapse / expand that section or module
  The floating inspector     the card next to the selected node or edge
                             (see below): click a value to edit it in
                             place, click < > to change a choice


6. CANVAS: KEYBOARD
-------------------

  h j k l / arrows    pan (with a count: 5l)
  H J K L             nudge the selected node by one grid step
  + / -               zoom in / out
  0                   zoom 100%
  f                   fit the whole diagram
  Z                   fit the selection
  a                   add a node at the mouse and rename it
  Enter               step into the floating inspector (below)
  i                   rename the node, or edit the selected edge's label
  I                   floating inspector on / off
  c                   collapse / expand the selected node
  yy  / Ctrl+c        copy the selection (22)
  p   / Ctrl+v        paste at the mouse;  P pastes in place
  x   / Ctrl+x        cut;  dd also keeps what it deleted for p
  D                   duplicate the selected node
  gx / gf             open the node's source link online / in your editor
  dd / Delete         delete the selection
  u / Ctrl+r          undo / redo (Ctrl+z also undoes)
  e                   cycle the edge tool (-> ..> -|> ..|> *-> o-> ...)
  r                   cycle default routing: orthogonal, straight, bezier
  L                   automatic layout (layered)
  F                   focus mode on / off (see 12)
  G                   grid style: dots, lines, off
  S                   snap to grid on / off
  m                   minimap on / off
  Tab                 select the next node and pan to it
  /                   search nodes, members, types and labels
  :                   command bar
  F1                  this manual

  The floating inspector is a small card next to the selected node or
  edge. It holds the Inspector's everyday fields (name, kind,
  stereotype, color, tag, note, sections and members) so you can edit
  without leaving the canvas. It hides while you drag, when more than
  one node is selected, and when the selection scrolls out of view.

  Mouse   click a value, member or section title to edit it in place;
          < and > step a choice (kind, routing); + on a section adds a
          member, x on a member deletes it; [-] collapses a section;
          the x in the corner closes the card until you click the
          node again. Clicking elsewhere keeps what you typed.
  Keys    Enter steps in from the canvas, then
          j / k        move
          h / l        change a choice, collapse / expand a section
          Enter        edit the value in place (Enter saves, Esc cancels)
          a / A        add a member / a section
          dd, Delete   delete the member or section
          Esc / Tab    back to the canvas
  Turn it off for good with :set floating inspector=off (or :view canvas).


7. TABLES: OUTLINE, INSPECTOR, EDGES, LAYERS, ...
--------------------------------------------------

  Every view except the canvas is a table with a row cursor.

  j / k / arrows      move the cursor
  gg / G              first / last row (5G goes to row 5)
  Home / End          first / last row
  Page Up / Down      one page
  Ctrl+d / Ctrl+u     half a page down / up
  l / Right           expand a tree row, or next value of a choice
  h / Left            collapse a tree row, or previous value of a choice
  Enter / Space / o   activate: edit a value, toggle, open
  a                   inspector: add a member to the current section
  A                   inspector: add a section
  dd                  delete the row's item (member, section, node, edge)
  drag a column
  header              reorder / resize columns (:columns shows hidden)

  Inspector, for a node: name, kind, stereotype, border, accent color,
  tag, note, documentation, source link, geometry, collapsed, pinned,
  then its sections and members. For an edge: relationship, routing,
  label, multiplicities, ports, tag, color, documentation, bends. With
  nothing selected: the diagram's title, routing, documentation and repo.
  Choice fields (kind, routing, ...) change with h / l.


8. PANELS AND TABS: KEYBOARD
----------------------------

  Ctrl+h j k l         focus the panel left / below / above / right
  Ctrl+w h j k l       same
  Ctrl+w v             split the panel vertically (same view, new tab)
  Ctrl+w s             split horizontally
  Ctrl+w c             close the focused tab
  Ctrl+w =             make all splits equal
  gt / gT              next / previous tab in the panel
  Ctrl+Tab             next tab anywhere (Ctrl+Shift+Tab: previous)
  Ctrl+= / Ctrl+-      bigger / smaller interface (Ctrl+0 resets)
  :vs <view>           split right with a view
  :sp <view>           split below with a view


9. NODES: KINDS, SECTIONS AND MEMBERS
-------------------------------------

  Kind       Looks like                    Use it for
  struct     card, accent bar              data layouts, plain structs
  class      card, accent bar              classes, managers, controllers
  interface  dashed border                 traits, protocols, interfaces
  enum       double accent bar             enums, tagged unions, variants
  module     dashed frame around children  packages, subsystems, processes
  system     accent header                 services, engines, threads
  storage    slab on top                   databases, queues, caches
  state      rounded pill                  state machine states, phases
  note       folded corner                 notes, decisions, legends
  lifeline   box + dashed line down        sequence diagram participant
  actor      stick figure + line           sequence diagram actor

  Change the kind any time: inspector, move to "kind", press h or l.

  Sections are named boxes inside a node (fields, methods, ports,
  memory, invariants: any name). A node can have any number of them.

  Members are the lines in a section. Type them like this:

      + rect[4] : f32 [0x00]
      | |         |   |
      | name      |   badge (optional, shown as a pill)
      |           type (optional, after the colon)
      visibility (optional): + public  - private  # protected
                             ~ package  @ port / event  * bullet

  Modules are containers: nodes inside a module move with it, and the
  module grows to fit them. Collapse a module with [-] to hide its
  children.


10. EDGES: KINDS, CREATING, ROUTING
-----------------------------------

  Symbol  Kind            Means
  ->      association     uses, references, calls
  ..>     dependency      weak / compile time dependency
  -|>     inheritance     extends
  ..|>    implements      implements an interface
  *->     composition     owns (filled diamond at the owner)
  o->     aggregation     holds, shared (hollow diamond)
  ==>     dataflow        hot data path, stream (thick line)
  ~>      async           message, event, queue
  <->     bidirectional   two way
  --      link            undirected
  ->>     message         sequence call (between lifelines)
  -->>    reply           sequence return, dashed

  Create: right-drag from a node onto another, or drag a port dot, or
  :connect <key1> <key2>. The new edge uses the current edge tool (press
  e to change it, the status bar shows edge:->).

  Edit: select the edge, then the inspector shows relationship, label,
  routing (auto / orthogonal / straight / bezier), multiplicities like 1
  and 0..*, ports (north / south / east / west) and a tag.

  :route ortho|straight|bezier sets the default routing for the diagram.

  Bends: select an edge and small dots appear in the middle of its
  segments. Drag one to put a bend there; the edge then runs through its
  bends (with right angles when the routing is orthogonal). Drag the
  square of a bend to move it, double click it to remove it. Bends move
  with their nodes when both ends are dragged together. Up to 8 bends per
  edge. "bends" in the inspector (Enter) or :straighten removes them.
  Automatic layout removes bends, they would point at the old places.


11. LAYOUT AND ALIGNMENT
------------------------

  L                    layered layout (top to bottom)
  :layout layered      same
  :layout lr           layered, left to right (good for pipelines)
  :layout force        spring layout, untangles dense graphs
  :layout grid         simple grid
  :layout sequence     lifelines in a row, messages evenly spaced (:seq)

  Select several nodes (shift click or box select), then:

  :align left | right | top | bot | cx | cy      line them up
  :align dh | dv                                 distribute evenly

  Pinned nodes (inspector: pinned) are left alone by automatic layout.


12. LAYERS AND FOCUS MODE
-------------------------

  Give nodes and edges a tag (inspector: tag, or tag= in the text
  format). The layers view lists every tag with node / edge counts.
  Enter on a tag hides it (and everything carrying it), Enter again
  shows it.

  Focus mode (F) dims everything that isn't within one hop of the
  selected node. :set focus hops=2 widens it to two hops.


13. SAVING AND EXPORTING
------------------------

  :save                    save to the opened file (or diagram.dit.txt)
  :save name.dit.txt       save as readable text
  :save name.dit           save as binary
  :export name.svg         vector image in the current colors (links are
                           clickable, docs show as hover text)
  :export name.png [2]     picture, 2 pixels per unit by default; any size,
                           it is drawn in window sized tiles (the window
                           shows the tiles for a moment)
  :export name.mmd [style] Mermaid; style is class, flowchart or sequence
                           (picked from the diagram when left out)
  :export name.md          Mermaid in a ```mermaid block (GitHub renders it)
  :export name.puml        PlantUML
  :export name.dit.txt     the text format, without changing the open file

  :save picks the format by extension: .dit is binary, anything else is
  text. Exporting without a window: design-it file.dit.txt --export=out.svg
  (also .mmd .puml .dit.txt); --export=out.png needs a display.


14. THE .dit.txt TEXT FORMAT
----------------------------

  A diagram file is plain text. The source view always shows the text of
  the current diagram, so the quickest way to learn it is to look there.

    diagram "Task Queue" routing=orthogonal

    module "Runtime" id=rt tag=core {
      interface "Job" id=job stereo="<<interface>>" {
        section "contract" {
          + run(ctx) : void [pure]
        }
      }
      struct "JobQueue" id=queue {
        note "lock free ring"
        section "fields" {
          + head : atomic<u64> [0x00]
          - slots : Job*[] [ring]
        }
      }
    }

    queue o-> job : "buffers" [1 -> 0..*]
    rt ==> job : "runs" route=bezier tag=hot

  Nodes:   <kind> "<name>" [id=key] [stereo="text"] [tag=name]
           [color=#RRGGBB] [link="path/file.c:42"] [x=N y=N] [w=N h=N]
           [collapsed=1] [pinned=1] [{ body }]
  Body:    note "text", doc """ ... """, section "title" { members },
           child nodes
  Edges:   <key> <symbol> <key> [: "label"] [[from -> to]]
           [route=mode] [from=north|south|east|west] [to=...] [tag=x]
           [color=#RRGGBB] [via=x,y;x,y] [y=N] [{ doc """ ... """ }]
           via= are the bends, y= the height of a sequence message
  Diagram: diagram "title" [routing=mode] [repo="url"] [ref="branch"]
           [root="path"], then an optional doc """ ... """
  Docs:    doc """ on its own line, the text, """ on its own line. The
           text keeps its line breaks; indentation up to the block's is
           removed. Strings in quotes escape \" and \\.
  Comments start with # or //.

  Leave out x= / y= and the diagram is laid out automatically when it
  loads, which makes the format easy to generate from scripts.


15. SCANNING C / C++ CODE
-------------------------

  :scan path/to/src, design-it --scan=path, or drop the folder on the
  window.

  Reads .h / .hpp files (four folder levels deep), skipping build,
  protocols and node_modules. Every node links to its file and line, and
  the repo url comes from the checkout's origin remote, so gx opens the
  definition online and gf in your editor (21). Every folder becomes a module; struct,
  class and enum definitions become nodes with their fields; base
  classes become inheritance edges, embedded fields composition edges
  and pointer fields association edges, attached to the field's row. The
  result is laid out automatically.

  Tips: press F and click a struct to see only its neighborhood, hide
  helper headers in the layers view, :save the result to keep your
  changes.


16. ALL COMMANDS
----------------

  :help [topic]                  this manual, jump to a topic
  :open <file>                   open .dit / .dit.txt / .mmd / .puml
                                 (or scan a folder)
  :import <file>                 merge a file into this diagram
  :save [file]                   save (.dit binary, otherwise text)
  :export <file> [opt]           .svg .png [scale] .mmd [style] .md .puml
  :doc                           edit the documentation (21)
  :link <path:line | url>        set the node's source link
  :browse / :src                 open the link online / in the editor
  :repo <url> [ref] | detect     where links open online
  :root <path>                   local checkout the links start from
  :copy / :paste                 clipboard (22)
  :straighten                    remove bends from the selected edges
  :seq                           re-space a sequence diagram
  :scan <file or folder>         build a diagram from C / C++ headers
  :tpl <name>                    arch ecs microservices compiler uml
                                 sequence stress
  :clear                         empty diagram
  :add <kind> <name>             add a node
  :connect <key> <key>           connect two nodes by key
  :layout layered|lr|force|grid  automatic layout
  :align left|right|top|bot|cx|cy|dh|dv
  :route ortho|straight|bezier   default edge routing
  :focus                         focus mode on / off
  :fit                           fit the diagram in the canvas
  :view <view>                   open or focus a view
  :vs <view> / :sp <view>        split right / below with a view
  :set <name>=<value>            change a setting (see 17)
  :zoom <0.6 - 3>                interface size
  :columns                       show hidden table columns again
  :reset                         default panel layout
  :q                             quit (settings and layout are saved)


17. SETTINGS AND COLOR SCHEMES
------------------------------

  Open a settings group as a view (:view appearance, colors, canvas,
  layout, behaviour, performance) and edit with h / l / Enter, or set by
  name:

    :set color scheme=nord
    :set grid style=lines
    :set font=Built-in Sans

  Color schemes: mono dark, mono light, amber, green phosphor, gruvbox,
  nord, solarized, high contrast, custom (edit single colors in :view
  colors).

  Some settings: zoom, color scheme, text weight, font, bold font, mono
  font, font size, small font size, grid style, grid size, snap to grid,
  default routing, minimap, edge labels, node shadows, smart guides,
  port handles, focus hops, row height, scroll smoothing, wheel lines,
  double click, frame rate. "reset all settings" in :view info restores
  the defaults.

  Fonts: design-it carries its own fonts (Built-in Sans, Built-in Sans
  Bold, Built-in Mono) and also lists the usual system fonts of your
  platform.

  Settings and the panel layout are saved when you quit, in:

    Windows   %APPDATA%\design-it\state.bin
    macOS     ~/Library/Application Support/design-it/state.bin
    Linux     ~/.local/share/design-it/state.bin  ($XDG_DATA_HOME if set)

  Delete that file to start over with defaults.


18. COMMAND LINE OPTIONS
------------------------

  design-it [file.dit | file.dit.txt] [options]

  --template=<name>     start from a template (arch ecs microservices
                        compiler uml stress)
  --scan=<path>         start from scanned C / C++ headers
  --export-svg=<file>   write an svg and exit (no window needed)
  --export=<file>       export by extension and exit: .svg .mmd .md .puml
                        .dit.txt .dit without a window, .png with one
  --export-style=<s>    .mmd: class | flowchart | sequence, .png: scale
  --set="name=value"    change a setting for this run (repeatable)
  --open=<view>         open or focus a view at startup
  --layer               overlay window (no frame, always on top)
  --anchor=<edges>      overlay position: top, bottom, left, right,
                        top-right, ... (implies --layer)
  --screenshot=<file>   render one frame to a .ppm image and exit
  --manual              print this manual and exit
  --help                print the options and exit


19. PLATFORM NOTES
------------------

  Every release build is a single executable with nothing to install. It
  needs a graphics driver with Vulkan, which every current driver for
  NVIDIA, AMD, Intel, Apple and Qualcomm GPUs includes.

  Windows (10 or newer, x64 or ARM64)
    - design-it.exe, double click it or drop a .dit file on it
    - the interface follows the display scale (125%, 150%, ...)

  macOS (11 or newer, Apple silicon and Intel)
    - the design-it binary runs from Terminal or Finder; design-it.app
      is the same program as a bundle, for "Open With", double clicking
      .dit files and dropping files on the dock icon
    - Cmd works like Ctrl: Cmd+z undo, Cmd+r redo, Cmd+w then v split,
      ...
    - Option types characters as usual (@, [, ~ on many layouts)
    - Cmd+q quits, Cmd+h hides, Cmd+m minimizes
    - a download from the internet may need right click > Open the first
      time (Gatekeeper)

  Linux (x86_64 or ARM64, glibc 2.35 or newer)
    - works on Wayland and on X11; Wayland is used when available
    - force one with DESIGN_IT_BACKEND=x11 or DESIGN_IT_BACKEND=wayland
    - needs libwayland-client, libxkbcommon and libX11, which every
      desktop has, plus the Vulkan loader (libvulkan.so.1) and your
      GPU's driver


20. TROUBLESHOOTING
-------------------

  "Vulkan was not found" / "could not start Vulkan"
      Install or update the graphics driver. On Linux install the Vulkan
      loader and driver (for example vulkan-loader and
      mesa-vulkan-drivers). In a virtual machine, enable 3D
      acceleration.

  The window opens but text looks wrong
      :set font=Built-in Sans   and   :set mono font=Built-in Mono

  Everything is too small or too big
      Ctrl+= / Ctrl+- or :zoom 1.4

  I lost my panels
      :reset

  A file won't open
      Check the status bar message. Text files must follow section 14;
      the source view of any diagram shows correct examples.

  Start completely fresh
      Delete state.bin (see 17).


21. DOCUMENTATION AND SOURCE LINKS
----------------------------------

  Every node, every edge and the diagram itself can carry documentation:
  as much text as you like, with line breaks. Nodes also carry a source
  link that points at the code they describe.

  Writing docs:
    - select a node or edge, then :doc, or Enter on "documentation" in the
      inspector or the floating card, or click the doc mark in the node's
      header (three short lines, shown when there is documentation)
    - with nothing selected :doc edits the diagram's own documentation

  The editor: type, Enter for a new line, arrows / Home / End / Page Up
  and Down move, Ctrl+v pastes, Ctrl+s (or Ctrl+Enter) saves, Esc
  cancels (with changes it asks for a second Esc).

  Reading docs: the docs view (:view docs) shows the selection's doc,
  link and repo, wrapped to the panel. Hover the doc mark on the canvas
  for a tooltip. / searches documentation text too.

  Source links: "path/in/repo.c:42" (also "file.c#L42", "file.c" or a full
  https:// url). Set one with :link, or "source link" in the inspector.
  A node with a link shows the link mark (an arrow out of a box).

    gx, :browse, click the mark   open it online
    gf, :src                      open the file in your editor

  Online needs the repo: :repo https://github.com/you/project main, or
  :repo detect to read it from the git checkout (origin remote and the
  current branch). GitHub, GitLab, Gitea, Codeberg and Bitbucket urls are
  built for you; anything else takes a template with {path} {line} {ref}:

    :repo https://cgit.example.org/proj/tree/{path}?h={ref}#n{line}

  Locally, links start from :root when set (absolute, or relative to the
  diagram file), otherwise from the git checkout around the diagram file.
  gf opens the file with the system opener, or at the exact line with
  DESIGN_IT_EDITOR set, for example:

    export DESIGN_IT_EDITOR="code -g {file}:{line}"
    export DESIGN_IT_EDITOR="zed {file}:{line}"
    export DESIGN_IT_EDITOR="kitty nvim +{line} {file}"

  In exports: SVG nodes link to their url and show their docs on hover,
  Mermaid and PlantUML get click links and docs as comments.


22. COPY AND PASTE
------------------

  yy (or Ctrl+c, :copy) copies the selected nodes, everything inside
  selected modules, and the edges between them. p (Ctrl+v) pastes at the
  mouse, P pastes at the original place. x / Ctrl+x cut. dd deletes and
  keeps the deleted nodes for p, without touching the system clipboard.

  The clipboard holds plain .dit.txt text: paste it into an editor, a
  chat or a commit message, and paste it into another design-it window.
  Pasting Mermaid or PlantUML text (from a README, an issue, a wiki)
  converts it and drops it at the mouse.

  In any text field Ctrl+v pastes the clipboard text.


23. SEQUENCE DIAGRAMS
---------------------

  Participants are lifeline (box) and actor (stick figure) nodes; :add
  lifeline Client, the palette, or :tpl sequence for an example. Messages
  are edges between lifelines, drawn as horizontal arrows:

    ->>   message (call), solid with a filled arrow
    -->>  reply, dashed with an open arrow
    ~>    async message

  Draw one by dragging along a lifeline (below its box) onto another, or
  onto itself for a self call; it lands at the height you started at.
  Drag a message up or down to reorder it. Move a lifeline by its box;
  its messages follow. Lifelines grow to fit their messages. :seq (or
  :layout sequence) lines the participants up and spaces the messages
  evenly. Modules make fragment frames (loop, alt, ...) and notes work as
  anywhere else.


24. MERMAID AND PLANTUML
------------------------

  Open (or drop, or :import to merge, or paste) .mmd / .mermaid and
  .puml / .plantuml files, or Markdown ```mermaid blocks:

    Mermaid    classDiagram, flowchart / graph (subgraphs, shapes,
               link labels, click links), sequenceDiagram (participants,
               actors, notes, loop / alt / opt frames, autonumber),
               stateDiagram, erDiagram
    PlantUML   class, interface, enum, abstract, entity, package,
               namespace, component, database, notes, [[links]],
               relations with multiplicities; sequence diagrams with
               participants, notes and alt / loop groups

  Styling (colors, classDef, skinparam) is dropped, structure, labels,
  multiplicities and links are kept. Export goes the other way with
  :export name.mmd / name.md / name.puml (13).