Skip to content

termaid 0.14.0

Choose a tag to compare

@fasouto fasouto released this 25 Nov 11:38
· 193 commits to main since this release

Behavior changes

  • Flowchart: the text of a -- text --> link can no longer contain the pair that opens it (--, == or -.), as in Mermaid. A -- run with --force --> B kept the whole text as its label and is now misread; write it as A -->|run with --force| B
  • A symbol that is not wide in Unicode's East Asian Width table, such as ♥, ❤, ☁ or a bare 🖥, now counts as 1 column instead of 2, which is how terminals draw it. Boxes around such labels come out one column narrower, including the icons of architecture diagrams
  • Flowchart: a cylinder's label no longer shares a row with the lid's rim. With padding_y=0, and with padding_y=1 for a label of two or more lines, the label was written over the rim (│╰─Store─╯│). The rim now always has its own row, so the most compact cylinder is four rows tall instead of three, and a label is centred in the body below the rim (#47)

Fixes

  • Claude Code hook: the text after a diagram that takes more than a second to draw is no longer lost or left inside an unclosed code block. The hook saves what the next batch needs before it draws, not after, and a batch that runs late no longer undoes the batches after it
  • Claude Code hook: the 3 second drawing limit covers every diagram in a batch together, so a batch with several slow diagrams is no longer stopped by Claude Code's own 10 second limit; the diagrams left over are shown as source
  • Claude Code hook: the first batch of a message starts from nothing, even when a state file is left from an earlier run of the same message
  • render_rich() and --theme no longer fail with 'NoneType' object has no attribute 'to_styled_pairs' on a source whose type termaid does not draw. Like render(), they give an empty drawing, and the command line says why. It broke in 0.13.0
  • A flowchart with no header whose first id starts like a diagram keyword (graphql --> api, pieces --> board, timelineStart --> done) is drawn again; blocker --> fix was drawn as a block diagram. The keyword has to be the whole first word. It broke in 0.13.0
  • Claude Code hook: a diagram is drawn even when Claude Code starts the hook for a batch before the hook for the batch before it has saved its state. The hook now waits for that batch, by its index, for up to 1 second. Before, the diagram was sometimes shown as Mermaid source
  • Labels with combining marks (Thai, Khmer, Hebrew with niqqud, Arabic with harakat, decomposed Vietnamese) no longer push box borders out of line, in every diagram type. A mark is drawn in the cell of the letter it sits on and counts as zero columns. ❤️ with its emoji selector counts as 2 columns instead of 4, and colours in render_rich no longer drift after a CJK label (#42, #43, thanks @nontravis)
  • Packet: a field wider than one row, such as 0-63: "Payload", keeps its continuation rows. Only the first 32 bits were drawn (#66, #67, thanks @anubhavlal07)
  • Gantt: dateFormat with month names (MMM D YYYY, MMMM D YYYY) no longer fails; axisFormat padding flags such as %-d work on Windows; a duration or date that runs past year 9999 no longer raises (#63, thanks @developingchet)
  • Flowchart: an id with a dash, such as go-on, is one node. The o-o inside it was read as a circle link between g and n. Circle and cross links need two dashes, as in Mermaid (#61, thanks @developingchet)
  • Flowchart: an arrow, ;, %% or ::: inside an unquoted node label, as in A[Load --> Parse], is label text instead of breaking the statement (#61, thanks @developingchet)
  • Flowchart: an entity code in an edge label, such as A -->|#quot;hi#quot;| B, is no longer cut at its ; (#61, thanks @developingchet)
  • Flowchart: a pipe label is recognised after a space (A --> |text| B) and on circle and cross links (A --o|text| B, A o--o|text| B) (#61, thanks @developingchet)
  • Flowchart: text is recognised on every kind of link, not only -- text -->: open links (A -- yes --- B), two-way links (A <-- yes --> B), circle and cross ends, and the thick and dotted forms (#61, thanks @developingchet)
  • Flowchart: @{ shape: trap-t } and trap-b were swapped. Shape names from Mermaid's table that map to shapes termaid draws now work (decision, database, process, pill, subproc, in-out, manual, odd and the long names such as lean-right) (#60, thanks @developingchet)
  • Flowchart: @{ ... } works on an id with a dash or a dot and when its keys are on separate lines. A forgotten } no longer swallows the rest of the diagram (#60, thanks @developingchet)
  • Flowchart: an edge id (A e1@--> B, e1@{ animate: true }) is no longer drawn as part of a node or as a node of its own (#60, thanks @developingchet)
  • Flowchart: class A,B name styles every node in the list and classDef a,b ... defines every name (#60, thanks @developingchet)
  • Flowchart: accTitle: and accDescr: lines and accDescr { ... } blocks are skipped instead of drawn as nodes, and an open dotted link takes any number of dots (A -..- B) (#60, thanks @developingchet)