The key spec builder the schema's tables are written with (spec/02 §1.2–§1.5).
Macaw.Frame.Document.Schema.Design, .Frame and .Layer write their tables with
spec/4; Macaw.Frame.Document.Schema reads them once, at compile time, so none of
them may depend on the schema module itself. A key spec is a map: the key, its type
(§1.4), its facet (§1.3), its default, whether it is required, and its merge rule (§1.5).
iex> Macaw.Frame.Document.Schema.Spec.spec(:gap, :number, :geometry, default: 0)
%{key: :gap, type: :number, facet: :geometry, default: 0, required: false, merge: :override, range: nil}
Summary
Functions
Every member of every enumeration inside a type, nested types included.
A key spec; default:, required: and merge: (:override when not given).
The type a styles entry takes (§2.6): a style node, a reference to another style, or a
list of references and nodes stacked left to right. A field or generator entry is a
site's alone.
The type a style site takes (§3.6): a reference, an inline node, a field binding whose value per datum names a style, a generator call whose result is a style, or a list of those, laid left to right.
Types
Functions
Every member of every enumeration inside a type, nested types included.
A key spec; default:, required: and merge: (:override when not given).
@spec style_entry() :: tuple()
The type a styles entry takes (§2.6): a style node, a reference to another style, or a
list of references and nodes stacked left to right. A field or generator entry is a
site's alone.
@spec style_stack() :: tuple()
The type a style site takes (§3.6): a reference, an inline node, a field binding whose value per datum names a style, a generator call whose result is a style, or a list of those, laid left to right.
iex> {:one_of, alternatives} = Macaw.Frame.Document.Schema.Spec.style_stack()
iex> {:ref, :style} in alternatives
true