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§
- Inline
Time - A moment written into rich text (
tilo_doc::inline_time), read: every reader sees it astime_labelreads it for them. - Reading
- Where, at
now, a person reads rich text: their zone and formats.
Enums§
- Time
Show - 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
linkto 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
linkmark’s target, in the one form every document codec already round-trips:tilo://open#…, the native linktilo_reference::link::Link::to_nativemakes. A link mark whose target starts with this scheme names a resource, so it is shown as aMark::ResourceLinkrather than an external URL. - TABLE_
SOURCE - A table the editor keeps as its Markdown source is a paragraph of that
source with this attribute,
truewhile 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
richas 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
keyof a paragraph. - byte_
of_ char - The byte offset of character
charsintext. - changes_
in - How soon, at
now, any time inrichreads differently. - char_
of_ byte - The character offset of byte
byteintext: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
keyof a paragraph. - is_
resource_ link - Whether a
linktarget 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_atshows 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 richwith the paragraphsblocksare: everything an editor’s document writes back (blocks_as_written’s inverse). A paragraph the person did not touch is kept asrichwrote it, marks the editor cannot draw included: it is found again amongrich’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 asrichsaid it, since that is the reader’s, not the text’s.- time_
label - What
timereads as for a person atnow, inzoneandformats. - view_of
- A paragraph a component is given, as tilo-doc reads it.
- view_
of_ content - The paragraph the editor block
contentis stored as:content_of’s inverse, in tilo-doc’s names, a list’s depth inlevel, and offsets counted in characters.