Annotation
An inline layer over a block's text: a type, one or more code-point ranges, an optional link and inline attributes, used for formatting, links and mentions.

Extends · open

type
Annotation kind, such as `Bold`, `Italic`, `Link`, `Embed` or `TextColor`.
optional
link
Target URL for `Link` and `Embed` annotations — an `hm://` or web URL.
optional
starts
Start offset of each covered range, in Unicode code points; parallel to `ends`.
of optional
ends
End offset (exclusive) of each covered range, in Unicode code points; parallel to `starts`.
of optional

An annotation is an inline layer over a block's text. Formatting, links and mentions are stored as a list of annotations beside the text, and the text itself holds no markup. Each annotation has a type, parallel starts and ends arrays naming one or more ranges (so one annotation can cover several stretches of text), an optional link, and any further attributes inline. Offsets count Unicode code points.

The Seed app writes these types: Bold, Italic, Underline, Strike, Code, Link (with link), Embed, Range (a highlight), and TextColor, BackgroundColor, TextSize and TextFamily (each with a value). Embed is an inline embed or mention: link plus mentionKind of account or document, over a single U+FEFF placeholder character in the text. As with blocks, an early comment encoding nested attributes under an attributes key, and the daemon reads both forms. See Blocks.

See also

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime