terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.

Home Page:https://d2lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FR: Allow grouping of elements in assignments

wpkelso opened this issue · comments

Example

// Current method
A -> C
B -> C

// Proposed method
A, B -> C

The syntax is obviously only a suggestion, but I think it fits with the existing syntax (another option could be to group using braces, i.e. {A, B} -> C).

Reasoning

As near as I can tell, we currently have no way to group elements in assignments. This means that if we have multiple elements going to one element or vice versa, the source file can get unwieldy with large amounts of similar lines. Collapsing them would make the source more legible.

Thank you for this. Folks have come to same conclusion, will aggregate in first issue: #742