Macaw.Frame.Document.Words (macaw_frame v0.1.0)

Copy Markdown View Source

The closed vocabularies a reader of a frame document looks words up in (spec/02 §9.3, §11.1).

keys/0 is every key of the schema, the singular wrappers of a typed fragment (§16.1) and the composite's keys: the map form reads a key as an atom only when this table has it, and keeps any other as its string for the validator to name. atoms/0 is every word a $atom may spell: the schema's enumerations, the fact keys, the data model's words, the units, the theme's slots, anchors and frame points. Nothing here is made from a document: a layer kind's, a model's, an operation's and a generator's names stay strings, and a category value is the library's atom only when one of these tables has it.

iex> Macaw.Frame.Document.Words.keys()["frames"]
:frames
iex> Macaw.Frame.Document.Words.atoms()["cubic_in_out"]
:cubic_in_out
iex> Macaw.Frame.Document.Words.keys()["line"]
nil

Summary

Functions

The text anchors of a label (§6.3): :title, :subtitle, :caption.

The atoms a document's $atom may spell (§9.3).

The corners and center a {:frame, c} anchor names (§6.3).

The keys a document's map form reads as atoms (§11.1).

The theme slots a :size, :font or :slot position may name (§1.4).

The length units a unit value {n, unit} names (§3.9).

The member of table a string spells, or the string itself, never a new atom; any other term as it is.

The singular wrapper keys of a typed fragment (§16.1).

Functions

anchors()

@spec anchors() :: [atom(), ...]

The text anchors of a label (§6.3): :title, :subtitle, :caption.

atoms()

@spec atoms() :: Macaw.Base.Vocabulary.table()

The atoms a document's $atom may spell (§9.3).

frame_points()

@spec frame_points() :: [atom(), ...]

The corners and center a {:frame, c} anchor names (§6.3).

keys()

@spec keys() :: Macaw.Base.Vocabulary.table()

The keys a document's map form reads as atoms (§11.1).

slots()

@spec slots() :: [atom(), ...]

The theme slots a :size, :font or :slot position may name (§1.4).

units()

@spec units() :: [atom(), ...]

The length units a unit value {n, unit} names (§3.9).

word(table, string)

@spec word(term(), term()) :: term()

The member of table a string spells, or the string itself, never a new atom; any other term as it is.

iex> Macaw.Frame.Document.Words.word(Macaw.Frame.Document.Words.atoms(), "linear")
:linear
iex> Macaw.Frame.Document.Words.word(Macaw.Frame.Document.Words.atoms(), "candlestick")
"candlestick"

wrappers()

@spec wrappers() :: [atom(), ...]

The singular wrapper keys of a typed fragment (§16.1).