SeaDoc support node types¶
Document format¶
SeaDoc documents stored on disk use format_version: 4. The persisted document envelope is:
{
"version": 1,
"format_version": 4,
"elements": [],
"last_modify_user": "user@example.com"
}
versionis required and records the document revision number.format_versionis required and is4for the current on-disk format.elementsis required and contains the top-level element nodes.last_modify_useris required and records the last modifying user. It may be an empty string when no user is available.
cursors is runtime collaboration response state. It is not part of the on-disk .sdoc format.
Nodes¶
Every node id is a required, non-empty string that is unique within its document. Consumers must not require a particular UUID or slug format.
Element nodes¶
An element node normally has:
id(required, string): unique node identifier.type(required, string): element type.children(required, array): child nodes.
Some elements have additional fields or a data object. See the page for that element type.
Text leaves¶
A text leaf has:
id(required, string): unique node identifier.text(required, string): displayed text.
Text leaves do not require type or children. For example:
{
"id": "text-id",
"text": "Text content"
}
Void elements¶
A void element stores its user-visible content in element properties rather than editable text. It still has children. The empty text leaf in children is a structural placeholder, not user content. Void does not mean the element has no children.
{
"id": "element-id",
"type": "divider",
"children": [
{
"id": "placeholder-id",
"text": ""
}
]
}
Divider¶
divider is a block-level void element representing a horizontal divider. It has no additional properties.
Historical documents may contain type: "hr". New documents use type: "divider". Compatibility and migration behavior may depend on the reader implementation.
Formula¶
formula is a block-level void element. Its formula source is stored in data.formula.
data(required, object): formula data.data.formula(required, string): formula source.
{
"id": "formula-id",
"type": "formula",
"data": {
"formula": "E = mc^2"
},
"children": [
{
"id": "formula-placeholder-id",
"text": ""
}
]
}
Rich-text marks¶
Text leaves may carry the following formatting fields:
bold,italic,underline,strikethrough,superscript,subscript, andcode(optional, boolean).colorandhighlight_color(optional, string).font_size(optional, number).font(optional, string).
Revision, diff, comment, selection, cursor, AI, and syntax-decoration fields are not ordinary rich-text formatting fields in this specification.
Node types¶
Content element types¶
The following element types are named in this specification release. This list is not a complete inventory of every element accepted by existing SeaDoc implementations. A name in this list does not mean the type has a dedicated structure page.
- blockquote
- callout
- check_list_item
- code_block
- divider
- embed_link
- file_link
- formula
- header1 through header6
- image
- image_block
- link
- multi_column
- ordered_list
- paragraph
- sdoc_link
- subtitle
- table
- title
- unordered_list
- video
- whiteboard
Structural element types¶
The following types occur only as children of their owning content element:
code_linewithincode_block.table_rowwithintable.table_cellwithintable_row.columnwithinmulti_column.