A Markdown document for MarkdownView or MarkdownBlocks, made by
Ui.markdown.
Remarks
Opaque, like ImageRef: pass it where the Slint type is
[MarkdownBlock]: the whole value of such a property (the blocks of
MarkdownView from @vestra/markdown.slint) or, a [MarkdownBlock] field
at any depth of a property value, such as the body of each row of a chat's
message list. It carries the text, the base address and the local copies of
its remote images; the player parses and draws it. Writing a document whose
text did not change (a new reference for the same text included) costs the
player no parsing, and a changed document updates only the blocks that
changed. It belongs to the scope that created it: once that scope is
disposed, writing it fails with invalid, wherever it is in the value.
Example: Show chat messages, one document per row
The chat window shows a formatted assistant message. ui.markdown
resolves once the document is ready (here without downloading images);
the reference goes into the body field of a row, whose Slint type is
[MarkdownBlock], and the player parses and draws it.
A Markdown document for
MarkdownVieworMarkdownBlocks, made by Ui.markdown.Remarks
Opaque, like ImageRef: pass it where the Slint type is
[MarkdownBlock]: the whole value of such a property (theblocksofMarkdownViewfrom@vestra/markdown.slint) or, a[MarkdownBlock]field at any depth of a property value, such as thebodyof each row of a chat's message list. It carries the text, the base address and the local copies of its remote images; the player parses and draws it. Writing a document whose text did not change (a new reference for the same text included) costs the player no parsing, and a changed document updates only the blocks that changed. It belongs to the scope that created it: once that scope is disposed, writing it fails withinvalid, wherever it is in the value.Example: Show chat messages, one document per row
The chat window shows a formatted assistant message.
ui.markdownresolves once the document is ready (here without downloading images); the reference goes into thebodyfield of a row, whose Slint type is[MarkdownBlock], and the player parses and draws it.Player
0.2.0
See
Ui.markdown, MarkdownOptions, PropValue
Since
1.1.0