Skip to main content

Module rich_doc

Module rich_doc 

Expand description

Between tilo-doc’s paragraphs and the block editor’s blocks, both ways.

tilo-doc names paragraph kinds and inline marks the way its codecs do (heading with a level, list_item with ordered/checked, strong, em), and counts offsets in characters. The block editor has its own kinds and marks and counts bytes. Everything the editor shows passes through content_of; everything it writes back, as a whole document, goes through view_of_content and block_of_view (the rich-text SDK writes an edit of one block as an action instead, tilo_rich_text).

Structs§

InlineTime
A moment written into rich text (tilo_doc::inline_time), read: every reader sees it as time_label reads it for them.
Reading
Where, at now, a person reads rich text: their zone and formats.

Enums§

TimeShow
How an inline time reads for the person reading.

Constants§

CALLOUT
The attribute that makes a quote a callout: the alert’s name (warning).
MAX_INDENT
The deepest list indent the editor draws.
PAGE_LINK_PREFIX
An internal link to another page is a link to this fragment prefix and the page’s id, which the document’s link validation accepts.
REFERENCE_MARK
The mark a reference’s run carries (tilo_reference::embed::MARK).
RESOURCE_LINK_SCHEME
The scheme a resource link is written with in a link mark’s target, in the one form every document codec already round-trips: tilo://open#…, the native link tilo_reference::link::Link::to_native makes. A link mark whose target starts with this scheme names a resource, so it is shown as a Mark::ResourceLink rather than an external URL.
TABLE_SOURCE
A table the editor keeps as its Markdown source is a paragraph of that source with this attribute, true while it shows as a grid.
TIME_MARK
The mark a time’s run carries (tilo_doc::inline_time).

Functions§

block_of_view
The paragraph a component is given for view: view_of’s inverse, its marks and attributes in the one form a window reads.
blocks_as_written
The blocks of rich as the editor that edits it holds them: each paragraph as its writer wrote it, every reference as its run (never as what a reader reads for it), and a block id that stands for its place, so the editor keeps a block’s widget from one presentation to the next.
blocks_at
The blocks rich text shows as for reading: each reference as the text says it reads for the person (reference_label), each time as it reads for them (time_label); paragraph ids are their places.
blocks_of
The blocks rich text shows as for the person reading here, now (blocks_at).
bool_attr
The boolean attribute key of a paragraph.
byte_of_char
The byte offset of character chars in text.
changes_in
How soon, at now, any time in rich reads differently.
char_of_byte
The character offset of byte byte in text: byte_of_char’s inverse.
content_of
What a paragraph shows as in the editor.
editor_mark
The editor mark a tilo-doc mark shows as, when it has one.
int_attr
The integer attribute key of a paragraph.
is_resource_link
Whether a link target names a resource of this desktop (RESOURCE_LINK_SCHEME) rather than a web address.
kind_of
The editor kind a paragraph shows as.
plain_text
The text rich text says to the person reading here, now, a line per paragraph: each reference and time as blocks_at shows it, never a run as written (a reference’s run keeps the title its resource had then, which the reader may not be allowed to read).
reading_here
The person reading here, now.
reference_label
What a reference reads as for the person reading, by how the text says it reads ([tilo_ui_graph::rich::InlineView]): a person as @ and what the workspace calls them, a resource by its title now (after what its type shows beside it, a task’s number), one kept elsewhere as its run, and one the reader cannot read as only that something is there.
rich_of_blocks
rich with the paragraphs blocks are: everything an editor’s document writes back (blocks_as_written’s inverse). A paragraph the person did not touch is kept as rich wrote it, marks the editor cannot draw included: it is found again among rich’s blocks by what it now reads as, so all it holds beyond that reads on. One they changed is written from what the editor shows. How each reference reads inline stays as rich said it, since that is the reader’s, not the text’s.
time_label
What time reads as for a person at now, in zone and formats.
view_of
A paragraph a component is given, as tilo-doc reads it.
view_of_content
The paragraph the editor block content is stored as: content_of’s inverse, in tilo-doc’s names, a list’s depth in level, and offsets counted in characters.