Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Document Model

The document model (s1-model) is a tree of nodes:

Document
  └─ Body
       ├─ Paragraph
       │    ├─ Run (formatting container)
       │    │    ├─ Text ("Hello ")
       │    │    └─ Text ("world")
       │    └─ Run (bold)
       │         └─ Text ("bold text")
       ├─ Table
       │    ├─ TableRow
       │    │    ├─ TableCell
       │    │    └─ TableCell
       │    └─ TableRow
       └─ Paragraph

Node Types

TypeDescriptionCan Contain
DocumentRoot nodeBody, Header, Footer, CommentBody
BodyMain contentParagraph, Table, TOC, PageBreak
ParagraphText containerRun, Image, LineBreak, Tab, Field
RunFormatting spanText
TextLeaf text content(none)
TableGrid containerTableRow
TableRowRowTableCell
TableCellCellParagraph
ImageInline image(none)

NodeId

Every node has a globally unique NodeId(replica_id, counter):

  • replica_id identifies the creating peer (for CRDT)
  • counter is monotonically increasing per replica

Attributes

Nodes carry an AttributeMap of key-value formatting:

  • Character: Bold, Italic, FontSize, FontFamily, Color
  • Paragraph: Alignment, SpacingBefore, SpacingAfter, IndentLeft
  • Image: ImageWidth, ImageHeight, ImageMediaId
  • Style: StyleId references a named Style definition