Jollywatt / typst-fletcher

Typst package for drawing diagrams with arrows, built on top of CeTZ.
MIT License
341 stars 6 forks source link

Explicitly error on `label-side: "left"` #25

Closed Jollywatt closed 5 months ago

Jollywatt commented 5 months ago

Currently, if the label-side option of edge() is given a string instead of one of left, center, right, nothing happens and the label side is the default.

#import "@preview/fletcher:0.4.3": diagram, node, edge

#diagram(edge([hello], label-side: "left"))

Instead this should error with a message like

label-side expected one of left, center, or right; got a string.

Jollywatt commented 5 months ago

Another annoyance is that label-side is impossible to type in math-mode — the entire edge() call must be #-escaped.

It may be worth allowing alignment objects (like left) to be passed as positional objects, since their type disambiguates them.