Macaw.Frame.TextForms (macaw_frame v0.1.0)

Copy Markdown View Source

The second cut's text forms (spec/02 §11.3, spec/13 §7.3): one Macaw.Frame.TextForm per diagram, each mermaid-like, read into a design of a layout frame whose node, edge, lane and grid layers draw the diagram's slots, the slots filled with static rows (a slot's rows), so the same design bound to sources draws a live diagram instead.

FormFirst wordSlotsLayout step
Flowchartflowchartnodes, edges, groupslayered
StatestateDiagramnodes, edges, groupslayered
ClassclassDiagramnodes, edges, memberslayered
ErerDiagramnodes, edges, attributeslayered
SequencesequenceDiagramnodes (participants), messagessequence
Ganttgantttasksgantt
Timelinetimelineeventsgantt (each event a milestone)
PageFlowpageFlownodes, edgeslayered (spec/13 §7.5)

Each answers every fault of a text at once, a syntax fault as {[:text, line, column], {:parse, reason}} (columns in grapheme clusters, from 1), and makes no atom of the text: names, labels and spellings stay strings. Each prints a design back canonically where it can (print/1), and parse(print(f)) reads f back.

iex> {:ok, registry} = Macaw.Frame.TextForms.registry()
iex> Map.keys(registry) |> Enum.sort()
["classDiagram", "erDiagram", "flowchart", "gantt", "pageFlow", "sequenceDiagram", "stateDiagram", "timeline"]

Summary

Functions

Every diagram text form, in spec/13 §7.3's order, then §7.5's page flow.

The registry of every diagram text form (Macaw.Frame.TextForm.registry/1).

Functions

all()

@spec all() :: [module()]

Every diagram text form, in spec/13 §7.3's order, then §7.5's page flow.

registry()

@spec registry() :: {:ok, Macaw.Frame.TextForm.registry()} | {:error, list()}

The registry of every diagram text form (Macaw.Frame.TextForm.registry/1).