moui_richtext

Optional rich text and markdown addon for MoUI

moui
richtext
markdown
gui
moon add wzzc-dev/moui_richtext@0.1.7
Download zip
Author
Version
0.1.7
License
Apache-2.0
Last updated
last month
Downloads
14

Dependencies

README

wzzc-dev/moui_richtext does not have a README file

#
RichTextFormatter

type RichTextFormatter = (String) -> RichTextDocument

#
CodeHighlightSpan

pub struct CodeHighlightSpan {
text : String
kind : CodeHighlightToken
}

A highlighted slice: a piece of source text and the token kind it belongs to.

#
CodeHighlightToken

pub enum CodeHighlightToken {
CodePlain
CodeKeyword
CodeString
CodeComment
CodeNumber
CodeFunction
CodeType
CodeOperator
CodeAnnotation
CodeEscape
} derive(Eq,
Debug
)

Token kinds produced by the highlighter, each with a stable color.

#
MarkdownBlock

pub(all) struct MarkdownBlock {
kind : MarkdownBlockKind
text : String
inlines : Array[MarkdownInline]
table_alignments : Array[
TextAlign
?]
code_language : String?
} derive(Eq, ToJson,
Debug
)

#
MarkdownBlockKind

pub(all) enum MarkdownBlockKind {
Heading(Int)
Paragraph
UnorderedListItem
TaskListItem(Bool)
OrderedListItem(Int)
Blockquote
CodeBlock
HorizontalRule
Table
FootnoteDefinition(String)
HtmlBlock
FrontMatter
} derive(Eq, ToJson,
Debug
)

#
MarkdownCodeFenceInfo

pub(all) struct MarkdownCodeFenceInfo {
marker : String
info : String?
} derive(Eq,
Debug
)

#
MarkdownDocumentBlock

pub(all) struct MarkdownDocumentBlock {
id : Int
revision : Int
source_range : MarkdownSourceRange
content_range : MarkdownSourceRange
kind : MarkdownBlockKind
text : String
fingerprint : String
inline_count : Int
} derive(Eq, ToJson,
Debug
)

#
MarkdownDocumentBlockHeightMetric

pub(all) struct MarkdownDocumentBlockHeightMetric {
block_id : Int
block_index : Int
revision : Int
source_range : MarkdownSourceRange
visual_top_units : Double
visual_height_units : Double
source_top_units : Double
source_height_units : Double
} derive(Eq, ToJson,
Debug
)

#
MarkdownDocumentDirtyRange

pub(all) struct MarkdownDocumentDirtyRange {
start_block : Int
end_block : Int
source_start : Int
source_end : Int
} derive(Eq, ToJson,
Debug
)

#
MarkdownDocumentHeightIndex

pub(all) struct MarkdownDocumentHeightIndex {
visual_content_units : Double
source_content_units : Double
blocks : Array[MarkdownDocumentBlockHeightMetric]
} derive(Eq, ToJson,
Debug
)

#
MarkdownDocumentLayoutBlock

pub(all) struct MarkdownDocumentLayoutBlock {
block_id : Int
block_index : Int
revision : Int
top : Double
height : Double
source_range : MarkdownSourceRange
} derive(Eq, ToJson,
Debug
)

#
MarkdownDocumentLayoutCache

pub(all) struct MarkdownDocumentLayoutCache {
revision : Int
width : Double
scroll_y : Double
viewport_height : Double
overscan : Double
content_height : Double
visible_start : Int
visible_end : Int
blocks : Array[MarkdownDocumentLayoutBlock]
} derive(Eq, ToJson,
Debug
)

#
MarkdownDocumentLayoutCache::new

fn MarkdownDocumentLayoutCache::new(session : MarkdownDocumentSession, document : RichTextDocument, base :
FontSpec
, width~ : Double, scroll_y~ : Double, viewport_height~ : Double, overscan? : Double, text_system? :
TextSystem
) -> MarkdownDocumentLayoutCache

#
MarkdownDocumentLayoutCache::source_offset_y

fn MarkdownDocumentLayoutCache::source_offset_y(self : MarkdownDocumentLayoutCache, source_offset : Int) -> Double?

#
MarkdownDocumentLayoutCache::visible_block_count

fn MarkdownDocumentLayoutCache::visible_block_count(self : MarkdownDocumentLayoutCache) -> Int

#
MarkdownDocumentRichTextWindow

pub(all) struct MarkdownDocumentRichTextWindow {
document : RichTextDocument
content_height : Double
top_padding : Double
scroll_y : Double
viewport_height : Double
overscan : Double
visible_start : Int
visible_end : Int
block_count : Int
rendered_block_count : Int
} derive(Eq, ToJson,
Debug
)

#
MarkdownDocumentRichTextWindow::caret_rect_at_source

#
MarkdownDocumentRichTextWindow::content_rect

#
MarkdownDocumentSession

pub(all) struct MarkdownDocumentSession {
source : String
source_length : Int
blocks : Array[MarkdownDocumentBlock]
editor_blocks : Array[MarkdownEditorBlock]
line_count : Int
word_count : Int
reading_minutes : Int
active_heading : String
metadata_title : String
metadata_tags : Array[String]
outline : Array[MarkdownEditorOutlineItem]
revision : Int
parse_count : Int
next_block_id : Int
dirty_range : MarkdownDocumentDirtyRange?
height_index : MarkdownDocumentHeightIndex
layout_cache : MarkdownDocumentLayoutCache?
} derive(Eq, ToJson,
Debug
)

#
MarkdownDocumentSession::apply

#
MarkdownDocumentSession::estimated_content_height

fn MarkdownDocumentSession::estimated_content_height(self : MarkdownDocumentSession, base? :
FontSpec
, source_mode? : Bool) -> Double

#
MarkdownDocumentSession::new

#
MarkdownDocumentSession::replace_source

fn MarkdownDocumentSession::replace_source(self : MarkdownDocumentSession, source : String, reason? : MarkdownEditReason) -> MarkdownDocumentSession

#
MarkdownDocumentSession::rich_text

fn MarkdownDocumentSession::rich_text(self : MarkdownDocumentSession, selection : MarkdownEditorSelection, base? :
FontSpec
, source_mode? : Bool, focus_mode? : Bool, base_dir? : String?) -> RichTextDocument

#
MarkdownDocumentSession::rich_text_window

fn MarkdownDocumentSession::rich_text_window(self : MarkdownDocumentSession, selection : MarkdownEditorSelection, base? :
FontSpec
, source_mode? : Bool, focus_mode? : Bool, base_dir? : String?, scroll_y? : Double, viewport_height? : Double, overscan? : Double) -> MarkdownDocumentRichTextWindow

#
MarkdownDocumentSession::snapshot

#
MarkdownDocumentSession::source

#
MarkdownDocumentSession::source_offset_y

fn MarkdownDocumentSession::source_offset_y(self : MarkdownDocumentSession, source_offset : Int, base? :
FontSpec
, source_mode? : Bool) -> Double

#
MarkdownDocumentSession::with_layout_cache

fn MarkdownDocumentSession::with_layout_cache(self : MarkdownDocumentSession, document : RichTextDocument, base :
FontSpec
, width~ : Double, scroll_y~ : Double, viewport_height~ : Double, overscan? : Double, text_system? :
TextSystem
) -> MarkdownDocumentSession

#
MarkdownEditReason

pub(all) enum MarkdownEditReason {
LoadDocument
TextInput
CommandEdit
ReplaceEdit
ToggleTaskEdit
MediaEdit
} derive(Eq, ToJson,
Debug
)

#
MarkdownEditTransaction

pub(all) struct MarkdownEditTransaction {
previous_source : String
source : String
edit_range : MarkdownSourceRange
replacement : String
caret : Int
selection :
TextRange
?
reason : MarkdownEditReason
} derive(Eq, ToJson,
Debug
)

#
MarkdownEditTransaction::from_edit_result

fn MarkdownEditTransaction::from_edit_result(previous_source : String, result : MarkdownEditorEditResult, reason? : MarkdownEditReason) -> MarkdownEditTransaction

#
MarkdownEditTransaction::from_input_transform

fn MarkdownEditTransaction::from_input_transform(previous_source : String, transform : RichTextInputTransform, reason? : MarkdownEditReason) -> MarkdownEditTransaction

#
MarkdownEditTransaction::from_sources

fn MarkdownEditTransaction::from_sources(previous_source : String, source : String, caret? : Int, selection? :
TextRange
?, reason? : MarkdownEditReason) -> MarkdownEditTransaction

#
MarkdownEditTransaction::replace_all

fn MarkdownEditTransaction::replace_all(previous_source : String, source : String, caret? : Int, selection? :
TextRange
?, reason? : MarkdownEditReason) -> MarkdownEditTransaction

#
MarkdownEditorAutolinkTarget

pub(all) struct MarkdownEditorAutolinkTarget {
leading : String
target : String
trailing : String
} derive(Eq,
Debug
)

#
MarkdownEditorBlock

pub(all) struct MarkdownEditorBlock {
block : MarkdownBlock
source_range : MarkdownSourceRange
content_range : MarkdownSourceRange
} derive(Eq, ToJson,
Debug
)

#
MarkdownEditorBlockGroup

pub(all) struct MarkdownEditorBlockGroup {
start_index : Int
end_index : Int
source_start : Int
source_end : Int
}

#
MarkdownEditorBlockPosition

pub(all) struct MarkdownEditorBlockPosition {
block : MarkdownEditorBlock
index : Int
}

#
MarkdownEditorCommand

pub(all) enum MarkdownEditorCommand {
Bold
Italic
Code
Strikethrough
Link
Image
SetLinkTarget(String)
SetImageTarget(String)
SetCodeLanguage(String)
SetFootnoteText(String)
SetHtmlBlockText(String)
Paragraph
Heading(Int)
BulletList
TaskList
OrderedList
Quote
CodeBlock
HorizontalRule
Table
InsertTableOfContents
InsertFrontMatter
DuplicateBlock
MoveBlockUp
MoveBlockDown
InsertTableRow
InsertTableColumn
DeleteTableRow
DeleteTableColumn
SetTableColumnAlignment(
TextAlign
?)
} derive(Eq, ToJson,
Debug
)

#
MarkdownEditorEditResult

pub(all) struct MarkdownEditorEditResult {
source : String
caret : Int
selection :
TextRange
?
} derive(Eq, ToJson,
Debug
)

#
MarkdownEditorFootnoteDefinitionEdit

pub(all) struct MarkdownEditorFootnoteDefinitionEdit {
source : String
anchor_delta : Int
}

#
MarkdownEditorFrontMatterMetadata

pub(all) struct MarkdownEditorFrontMatterMetadata {
title : String
tags : Array[String]
}

#
MarkdownEditorFrontMatterParseResult

pub(all) struct MarkdownEditorFrontMatterParseResult {
block : MarkdownEditorBlock
next_index : Int
} derive(Eq,
Debug
)

#
MarkdownEditorHtmlBlockParseResult

type MarkdownEditorHtmlBlockParseResult derive(Eq,
Debug
)

#
MarkdownEditorIndentedCodeParseResult

type MarkdownEditorIndentedCodeParseResult derive(Eq,
Debug
)

#
MarkdownEditorLineBlockParts

pub(all) struct MarkdownEditorLineBlockParts {
context_prefix : String
content_start : Int
content : String
}

#
MarkdownEditorMergeBlockKind

pub(all) enum MarkdownEditorMergeBlockKind {
Plain
Bullet
Task
Ordered
Quote
} derive(Eq,
Debug
)

#
MarkdownEditorOffsetReplacement

pub(all) struct MarkdownEditorOffsetReplacement {
start : Int
old_end : Int
new_end : Int
} derive(Eq,
Debug
)

#
MarkdownEditorOrderedLineInfo

pub(all) struct MarkdownEditorOrderedLineInfo {
indent : Int
context_prefix : String
digit_start : Int
digit_end : Int
digits : String
number : Int
} derive(Eq,
Debug
)

#
MarkdownEditorOrderedRenumberContext

pub(all) struct MarkdownEditorOrderedRenumberContext {
indent : Int
context_prefix : String
expected : Int
} derive(Eq,
Debug
)

#
MarkdownEditorOutlineItem

pub(all) struct MarkdownEditorOutlineItem {
level : Int
title : String
source_start : Int
} derive(Eq, ToJson,
Debug
)

#
MarkdownEditorParagraphParseResult

type MarkdownEditorParagraphParseResult derive(Eq,
Debug
)

#
MarkdownEditorPasteReferenceCommand

pub(all) struct MarkdownEditorPasteReferenceCommand {
command : MarkdownEditorCommand
target : String
reference_style : Bool
definition_text : String
}

#
MarkdownEditorPastedFootnoteDefinition

pub(all) struct MarkdownEditorPastedFootnoteDefinition {
label : String
text : String
}

#
MarkdownEditorPastedMarkdownTable

pub(all) struct MarkdownEditorPastedMarkdownTable {
grid : Array[Array[String]]
alignments : Array[
TextAlign
?]
table_text : String
} derive(Eq,
Debug
)

#
MarkdownEditorPastedReferenceDefinition

pub(all) struct MarkdownEditorPastedReferenceDefinition {
label : String
target : String
definition_text : String
}

#
MarkdownEditorPastedReferenceTarget

pub(all) struct MarkdownEditorPastedReferenceTarget {
target : String
image : Bool
reference_style : Bool
}

#
MarkdownEditorQuotedCodeBlock

pub(all) struct MarkdownEditorQuotedCodeBlock {
source_range : MarkdownSourceRange
content_range : MarkdownSourceRange
} derive(Eq,
Debug
)

#
MarkdownEditorQuotedCodeFence

pub(all) struct MarkdownEditorQuotedCodeFence {
quote_prefix : String
fence : String
} derive(Eq,
Debug
)

#
MarkdownEditorReferenceMarkerTarget

pub(all) struct MarkdownEditorReferenceMarkerTarget {
start : Int
end : Int
label : String
}

#
MarkdownEditorRenumberResult

pub(all) struct MarkdownEditorRenumberResult {
text : String
replacements : Array[MarkdownEditorOffsetReplacement]
} derive(Eq,
Debug
)

#
MarkdownEditorRunSourceRange

type MarkdownEditorRunSourceRange derive(Eq,
Debug
)

#
MarkdownEditorSelection

pub(all) struct MarkdownEditorSelection {
caret : Int
selection :
TextRange
?
} derive(Eq, ToJson,
Debug
)

#
MarkdownEditorSetextHeadingParseResult

type MarkdownEditorSetextHeadingParseResult derive(Eq,
Debug
)

#
MarkdownEditorSnapshot

pub(all) struct MarkdownEditorSnapshot {
source : String
blocks : Array[MarkdownEditorBlock]
rich_text : RichTextDocument
line_count : Int
word_count : Int
reading_minutes : Int
active_heading : String
metadata_title : String
metadata_tags : Array[String]
outline : Array[MarkdownEditorOutlineItem]
} derive(Eq, ToJson,
Debug
)

#
MarkdownEditorSnapshot::parse

fn MarkdownEditorSnapshot::parse(source : String) -> MarkdownEditorSnapshot

#
MarkdownEditorSnapshot::parse_with_font

fn MarkdownEditorSnapshot::parse_with_font(source : String, base :
FontSpec
, base_dir? : String?) -> MarkdownEditorSnapshot

#
MarkdownEditorTableCellRange

pub(all) struct MarkdownEditorTableCellRange {
hit_start : Int
hit_end : Int
content_start : Int
content_end : Int
row : Int
column : Int
} derive(Eq,
Debug
)

#
MarkdownEditorTableMatrixPaste

pub(all) struct MarkdownEditorTableMatrixPaste {
grid : Array[Array[String]]
alignments : Array[
TextAlign
?]
}

#
MarkdownEditorTableParseResult

pub(all) struct MarkdownEditorTableParseResult {
block : MarkdownEditorBlock
end_index : Int
} derive(Eq,
Debug
)

#
MarkdownEditorTablePasteTarget

pub(all) struct MarkdownEditorTablePasteTarget {
row : Int
column : Int
}

#
MarkdownFrontMatterParseResult

pub(all) struct MarkdownFrontMatterParseResult {
block : MarkdownBlock
next_index : Int
} derive(Eq,
Debug
)

#
MarkdownHtmlBlockParseResult

type MarkdownHtmlBlockParseResult derive(Eq,
Debug
)

#
MarkdownHtmlEntityDecodeResult

type MarkdownHtmlEntityDecodeResult derive(Eq,
Debug
)

#
MarkdownIndentedCodeParseResult

type MarkdownIndentedCodeParseResult derive(Eq,
Debug
)

#
MarkdownInline

pub(all) struct MarkdownInline {
text : String
kind : MarkdownInlineKind
target : String?
} derive(Eq, ToJson,
Debug
)

#
MarkdownInlineKind

pub(all) enum MarkdownInlineKind {
Plain
Bold
Italic
Code
Strikethrough
Link
Autolink
Image
FootnoteReference
HtmlInline
} derive(Eq, ToJson,
Debug
)

#
MarkdownLine

pub(all) struct MarkdownLine {
text : String
start : Int
end : Int
} derive(Eq,
Debug
)

#
MarkdownLinkBounds

pub(all) struct MarkdownLinkBounds {
open_start : Int
close_start : Int
target_end : Int
target_start : Int
definition_target_start : Int
definition_target_end : Int
reference_label : String
} derive(Eq,
Debug
)

#
MarkdownParagraphParseResult

type MarkdownParagraphParseResult derive(Eq,
Debug
)

#
MarkdownReferenceContext

pub(all) struct MarkdownReferenceContext {
range :
TextRange

bounds : MarkdownLinkBounds
} derive(Eq,
Debug
)

#
MarkdownReferenceDefinition

pub(all) struct MarkdownReferenceDefinition {
label : String
url : String
title : String
} derive(Eq,
Debug
)

#
MarkdownSetextHeadingParseResult

type MarkdownSetextHeadingParseResult derive(Eq,
Debug
)

#
MarkdownSourceRange

pub(all) struct MarkdownSourceRange {
start : Int
end : Int
} derive(Eq, ToJson,
Debug
)

#
MarkdownTableCellPreviewRange

pub(all) struct MarkdownTableCellPreviewRange {
text : String
start : Int
end : Int
}

#
MarkdownTableParseResult

pub(all) struct MarkdownTableParseResult {
block : MarkdownBlock
end_index : Int
} derive(Eq,
Debug
)

#
RichTextBlock

pub(all) struct RichTextBlock {
runs : Array[RichTextRun]
table : RichTextTable?
prefix : String
font :
FontSpec
?
color :
Color
?
background :
Brush
?
border_left :
BorderStyle
?
inset :
Insets

line_height : Double?
corner_radius : Double
rule : Bool
source_range : RichTextSourceRange?
content_range : RichTextSourceRange?
} derive(Eq, ToJson,
Debug
)

#
RichTextBlock::new

fn RichTextBlock::new(runs~ : Array[RichTextRun], table? : RichTextTable?, prefix? : String, font? :
FontSpec
?, color? :
Color
?, background? :
Brush
?, border_left? :
BorderStyle
?, inset? :
Insets
, line_height? : Double?, corner_radius? : Double, rule? : Bool, source_range? : RichTextSourceRange?, content_range? : RichTextSourceRange?) -> RichTextBlock

#
RichTextDecoration

pub(all) enum RichTextDecoration {
Strikethrough
} derive(Eq, ToJson,
Debug
)

#
RichTextDocument

pub(all) struct RichTextDocument {
blocks : Array[RichTextBlock]
} derive(Eq, ToJson,
Debug
)

#
RichTextDocument::new

#
RichTextDocument::plain

fn RichTextDocument::plain(text : String) -> RichTextDocument

#
RichTextInputTransform

pub(all) struct RichTextInputTransform {
text : String
caret : Int
selection :
TextRange
?
} derive(Eq, ToJson,
Debug
)

#
RichTextInputTransform::new

fn RichTextInputTransform::new(text~ : String, caret~ : Int, selection? :
TextRange
?) -> RichTextInputTransform

#
RichTextRun

pub(all) struct RichTextRun {
text : String
visual_text : String?
image_source : String?
image_size :
Size
?
image_fit :
ImageFit

font :
FontSpec
?
color :
Color
?
background :
Brush
?
background_radius : Double
decoration : RichTextDecoration?
source_range : RichTextSourceRange?
} derive(Eq, ToJson,
Debug
)

#
RichTextRun::new

fn RichTextRun::new(text~ : String, visual_text? : String?, image_source? : String?, image_size? :
Size
?, image_fit? :
ImageFit
, font? :
FontSpec
?, color? :
Color
?, background? :
Brush
?, background_radius? : Double, decoration? : RichTextDecoration?, source_range? : RichTextSourceRange?) -> RichTextRun

#
RichTextSourceRange

pub(all) struct RichTextSourceRange {
start : Int
end : Int
} derive(Eq, ToJson,
Debug
)

#
RichTextTable

pub(all) struct RichTextTable {
rows : Array[Array[RichTextTableCell]]
row_height : Double
cell_padding :
Insets

border :
Color

header_background :
Brush
?
} derive(Eq, ToJson,
Debug
)

#
RichTextTableCell

pub(all) struct RichTextTableCell {
text : String
header : Bool
align :
TextAlign
?
source_range : RichTextSourceRange?
} derive(Eq, ToJson,
Debug
)

#
code_highlight_supports_language

fn code_highlight_supports_language(language : String) -> Bool

True if the language id has a highlighter. Used to decide whether to apply token coloring or fall back to a single plain run.

#
code_highlight_tokenize

fn code_highlight_tokenize(source : String, language : String) -> Array[CodeHighlightSpan]

Tokenize a code source into highlight spans. Adjacent spans of the same kind are merged so the run list stays compact. Returns a single plain span when the language is unsupported or the source is empty.

#
controlled_markdown_editor

fn[Msg] controlled_markdown_editor(value~ : String, on_input~ : (String) -> Msg, placeholder~ : String, size~ :
Size
, font~ :
FontSpec
, foreground~ :
Color
, placeholder_color~ :
Color
, background~ :
Brush
, border? :
BorderStyle
?, focused_border? :
BorderStyle
?, cursor_color~ :
Color
, corner_radius? : Double, on_selection_change? : (Int,
TextRange
?) -> Msg?, on_prefix_click? : (Int) -> Msg?, accepts_tab_input? : Bool, key? : String?) ->
View
[Msg]

#
controlled_markdown_session_editor

fn[Msg] controlled_markdown_session_editor(session~ : MarkdownDocumentSession, selection~ : MarkdownEditorSelection, on_transaction~ : (MarkdownEditTransaction) -> Msg, placeholder~ : String, size~ :
Size
, font~ :
FontSpec
, foreground~ :
Color
, placeholder_color~ :
Color
, background~ :
Brush
, border? :
BorderStyle
?, focused_border? :
BorderStyle
?, cursor_color~ :
Color
, corner_radius? : Double, source_mode? : Bool, focus_mode? : Bool, base_dir? : String?, on_selection_change? : (Int,
TextRange
?) -> Msg?, on_prefix_click? : (Int) -> Msg?, on_command_click? : (Int) -> Msg?, accepts_tab_input? : Bool, visible_scroll_y? : Double, visible_viewport_height? : Double, visible_overscan? : Double, visible_scroll_state? :
ScrollState
?, key? : String?) ->
View
[Msg]

#
controlled_rich_text_document_editor

fn[Msg] controlled_rich_text_document_editor(value~ : String, document~ : RichTextDocument, on_input~ : (String) -> Msg, placeholder~ : String, size~ :
Size
, font~ :
FontSpec
, foreground~ :
Color
, placeholder_color~ :
Color
, background~ :
Brush
, border? :
BorderStyle
?, focused_border? :
BorderStyle
?, cursor_color~ :
Color
, corner_radius? : Double, on_selection_change? : (Int,
TextRange
?) -> Msg?, on_prefix_click? : (Int) -> Msg?, on_command_click? : (Int) -> Msg?, input_transform? : (String, Int,
TextRange
?, String) -> RichTextInputTransform??, accepts_tab_input? : Bool, visible_scroll_y? : Double, visible_viewport_height? : Double, visible_overscan? : Double, visible_scroll_state? :
ScrollState
?, selection_caret? : Int, selection_range? :
TextRange
?, kind? : String, key? : String?) ->
View
[Msg]

#
controlled_rich_text_editor

fn[Msg] controlled_rich_text_editor(value~ : String, on_input~ : (String) -> Msg, placeholder~ : String, size~ :
Size
, format~ : (String) -> RichTextDocument, font~ :
FontSpec
, foreground~ :
Color
, placeholder_color~ :
Color
, background~ :
Brush
, border? :
BorderStyle
?, focused_border? :
BorderStyle
?, cursor_color~ :
Color
, corner_radius? : Double, on_selection_change? : (Int,
TextRange
?) -> Msg?, on_prefix_click? : (Int) -> Msg?, on_command_click? : (Int) -> Msg?, input_transform? : (String, Int,
TextRange
?, String) -> RichTextInputTransform??, accepts_tab_input? : Bool, visible_scroll_y? : Double, visible_viewport_height? : Double, visible_overscan? : Double, visible_scroll_state? :
ScrollState
?, selection_caret? : Int, selection_range? :
TextRange
?, kind? : String, key? : String?) ->
View
[Msg]

#
markdown_block_to_rich_text

fn markdown_block_to_rich_text(block : MarkdownBlock, base :
FontSpec
, base_dir? : String?) -> RichTextBlock

#
markdown_document

fn markdown_document(source : String, base? :
FontSpec
) -> RichTextDocument

#
markdown_editor

fn[Msg] markdown_editor(value~ :
Binding
[String], placeholder~ : String, size~ :
Size
, font~ :
FontSpec
, foreground~ :
Color
, placeholder_color~ :
Color
, background~ :
Brush
, border? :
BorderStyle
?, focused_border? :
BorderStyle
?, cursor_color~ :
Color
, corner_radius? : Double, on_input? : (String) -> Msg?, on_selection_change? : (Int,
TextRange
?) -> Msg?, on_prefix_click? : (Int) -> Msg?, accepts_tab_input? : Bool, key? : String?) ->
View
[Msg]

#
markdown_editor_active_block_label

fn markdown_editor_active_block_label(source : String, selection : MarkdownEditorSelection) -> String

#
markdown_editor_active_selection

fn markdown_editor_active_selection(selection :
TextRange
?) ->
TextRange
?

#
markdown_editor_apply_command_at

fn markdown_editor_apply_command_at(source : String, command : MarkdownEditorCommand, selection : MarkdownEditorSelection?) -> MarkdownEditorEditResult

#
markdown_editor_ascii_word_char

fn markdown_editor_ascii_word_char(ch : Char) -> Bool

#
markdown_editor_clamp_int

fn markdown_editor_clamp_int(value : Int, min : Int, max : Int) -> Int

#
markdown_editor_format

fn markdown_editor_format(source : String, base? :
FontSpec
, base_dir? : String?) -> RichTextDocument

#
markdown_editor_format_for_selection

fn markdown_editor_format_for_selection(source : String, selection : MarkdownEditorSelection, base? :
FontSpec
, base_dir? : String?) -> RichTextDocument

#
markdown_editor_format_for_writing_mode

fn markdown_editor_format_for_writing_mode(source : String, selection : MarkdownEditorSelection, base? :
FontSpec
, focus_mode~ : Bool, base_dir? : String?) -> RichTextDocument

#
markdown_editor_image_context

fn markdown_editor_image_context(source : String, selection : MarkdownEditorSelection) -> MarkdownReferenceContext?

#
markdown_editor_indent_lines

fn markdown_editor_indent_lines(source : String, caret : Int, selection :
TextRange
?) -> RichTextInputTransform

#
markdown_editor_inline_marker

fn markdown_editor_inline_marker(command : MarkdownEditorCommand) -> String

#
markdown_editor_inline_marker_pair_at_caret

fn markdown_editor_inline_marker_pair_at_caret(source : String, caret : Int, marker : String) ->
TextRange
?

#
markdown_editor_insert_hard_break

fn markdown_editor_insert_hard_break(source : String, caret : Int, selection :
TextRange
?) -> RichTextInputTransform?

fn markdown_editor_link_context(source : String, selection : MarkdownEditorSelection) -> MarkdownReferenceContext?

#
markdown_editor_max_int

fn markdown_editor_max_int(a : Int, b : Int) -> Int

#
markdown_editor_outdent_lines

fn markdown_editor_outdent_lines(source : String, caret : Int, selection :
TextRange
?) -> RichTextInputTransform?

#
markdown_editor_preview_text

fn markdown_editor_preview_text(source : String) -> String

#
markdown_editor_range_has_inline_marker

fn markdown_editor_range_has_inline_marker(source : String, range :
TextRange
, marker : String) -> Bool

#
markdown_editor_selected_footnote_text

fn markdown_editor_selected_footnote_text(source : String, selection : MarkdownEditorSelection) -> String?

#
markdown_editor_selected_html_block_text

fn markdown_editor_selected_html_block_text(source : String, selection : MarkdownEditorSelection) -> String?

#
markdown_editor_selected_image_target

fn markdown_editor_selected_image_target(source : String, selection : MarkdownEditorSelection) -> String?

fn markdown_editor_selected_link_target(source : String, selection : MarkdownEditorSelection) -> String?

#
markdown_editor_substring

fn markdown_editor_substring(source : String, start : Int, end : Int) -> String

#
markdown_editor_text_length

fn markdown_editor_text_length(source : String) -> Int

#
markdown_editor_toggle_current_task

fn markdown_editor_toggle_current_task(source : String, selection : MarkdownEditorSelection) -> MarkdownEditorEditResult?

#
markdown_editor_toggle_task_at

fn markdown_editor_toggle_task_at(source : String, content_offset : Int) -> MarkdownEditorEditResult?

#
markdown_editor_transform_input

fn markdown_editor_transform_input(source : String, caret : Int, selection :
TextRange
?, input : String) -> RichTextInputTransform?

#
markdown_input_transform

fn markdown_input_transform(source : String, caret : Int, selection :
TextRange
?, inserted : String) -> RichTextInputTransform?

#
markdown_join_lines

fn markdown_join_lines(lines : Array[String]) -> String

#
markdown_split_lines

fn markdown_split_lines(text : String) -> Array[String]

#
markdown_split_table_cells

fn markdown_split_table_cells(line : String) -> Array[String]

#
markdown_viewer

fn[Msg] markdown_viewer(source~ : String, size~ :
Size
, font? :
FontSpec
, foreground? :
Color
, background? :
Brush
, corner_radius? : Double, on_link_click? : (String) -> Msg?, visible_scroll_y? : Double, visible_viewport_height? : Double, visible_overscan? : Double, visible_scroll_state? :
ScrollState
?, key? : String?) ->
View
[Msg]

A read-only markdown viewer that renders markdown source using the same MarkdownDocumentSession pipeline as the markdown editor, but without editing capabilities (no caret, selection, IME, or keyboard input).

The viewer is designed for embedding inside a scroll_view or similar scrollable parent. Pass visible_scroll_y, visible_viewport_height, and visible_overscan so the paint pass can cull off-screen blocks for performance, matching the session editor's windowed rendering strategy.

#
parse_markdown

fn parse_markdown(text : String) -> Array[MarkdownBlock]

#
parse_markdown_inlines

fn parse_markdown_inlines(text : String) -> Array[MarkdownInline]

#
parse_markdown_inlines_with_definitions

fn parse_markdown_inlines_with_definitions(text : String, definitions : Array[MarkdownReferenceDefinition]) -> Array[MarkdownInline]

#
rich_text_document_caret_rect_at_source

fn rich_text_document_caret_rect_at_source(document : RichTextDocument, source_caret : Int, content :
Rect
, base_font :
FontSpec
, text_system? :
TextSystem
) ->
Rect
?

#
rich_text_document_height

fn rich_text_document_height(document : RichTextDocument, base_font :
FontSpec
, text_system? :
TextSystem
) -> Double

#
rich_text_editor

fn[Msg] rich_text_editor(value~ :
Binding
[String], placeholder~ : String, size~ :
Size
, format~ : (String) -> RichTextDocument, font~ :
FontSpec
, foreground~ :
Color
, placeholder_color~ :
Color
, background~ :
Brush
, border? :
BorderStyle
?, focused_border? :
BorderStyle
?, cursor_color~ :
Color
, corner_radius? : Double, on_input? : (String) -> Msg?, on_input_edit? : (String, Int,
TextRange
?) -> Msg?, on_selection_change? : (Int,
TextRange
?) -> Msg?, on_prefix_click? : (Int) -> Msg?, on_command_click? : (Int) -> Msg?, input_transform? : (String, Int,
TextRange
?, String) -> RichTextInputTransform??, accepts_tab_input? : Bool, visible_scroll_y? : Double, visible_viewport_height? : Double, visible_overscan? : Double, visible_scroll_state? :
ScrollState
?, selection_caret? : Int, selection_range? :
TextRange
?, kind? : String, key? : String?) ->
View
[Msg]

#
rich_text_editor_content_rect

fn rich_text_editor_content_rect(frame :
Rect
) ->
Rect

#
text_viewer

fn[Msg] text_viewer(source~ : String, size~ :
Size
, font? :
FontSpec
, foreground? :
Color
, key? : String?) ->
View
[Msg]

A read-only plain text viewer that renders text using proper text measurement and word-wrapping, matching the RichText pipeline.