class

Tui::MarkdownView

Inherits Tui::Widget / Tui::Reactive / Reference / Object

Constructors

new(id : String | Nil = nil)
Source

Instance methods

append(text : String) : Nil

Append text (for streaming)

Source
at_bottom?

Check if scrolled to bottom (or within 2 lines of bottom)

Source
background

Background color for the view (nil = transparent/inherit from parent) Set this to match parent container's background for proper rendering

Source
background=(background : Color | Nil)

Background color for the view (nil = transparent/inherit from parent) Set this to match parent container's background for proper rendering

Source
blockquote_bar
Source
blockquote_bar=(blockquote_bar : Style)
Source
blockquote_style
Source
blockquote_style=(blockquote_style : Style)
Source
bold_style
Source
bold_style=(bold_style : Style)
Source
clear

Clear content

Source
clear_selection

Clear selection

Source
code_block_border
Source
code_block_border=(code_block_border : Style)
Source
code_block_style
Source
code_block_style=(code_block_style : Style)
Source
code_style
Source
code_style=(code_style : Style)
Source
collapse_all_details

Collapse all details

Source
content
Source
content=(markdown : String) : Nil

Set markdown content (full replace)

Source
content_height
Source
copy_selection_to_clipboard

Copy selection to clipboard (cross-platform: macOS, Linux)

Source
cursor_char

Streaming cursor

Source
cursor_char=(cursor_char : Char)

Streaming cursor

Source
cursor_style
Source
cursor_style=(cursor_style : Style)
Source
details_collapsed_char
Source
details_collapsed_char=(details_collapsed_char : Char)
Source
details_content_style
Source
details_content_style=(details_content_style : Style)
Source
details_expanded_char
Source
details_expanded_char=(details_expanded_char : Char)
Source
details_header_style

Details (collapsible) styles

Source
details_header_style=(details_header_style : Style)

Details (collapsible) styles

Source
expand_all_details

Expand all details

Source
has_selection?

Check if there's an active selection

Source
heading1_style

Styles for different elements

Source
heading1_style=(heading1_style : Style)

Styles for different elements

Source
heading2_style
Source
heading2_style=(heading2_style : Style)
Source
heading3_style
Source
heading3_style=(heading3_style : Style)
Source
heading4_style
Source
heading4_style=(heading4_style : Style)
Source
horizontal_scroll_enabled=(horizontal_scroll_enabled : Bool)

Horizontal scroll settings

Source
horizontal_scroll_enabled?

Horizontal scroll settings

Source
horizontal_scroll_step
Source
horizontal_scroll_step=(horizontal_scroll_step : Int32)
Source
hr_style
Source
hr_style=(hr_style : Style)
Source
italic_style
Source
italic_style=(italic_style : Style)
Source
list_bullet_style
Source
list_bullet_style=(list_bullet_style : Style)
Source
on_code_copy
Source
on_event(event : Event) : Bool

Override to handle events for this widget (target/bubble phase) Called after children have had a chance to handle the event

Source
padding_left

Content padding (space from edges)

Source
padding_left=(padding_left : Int32)

Content padding (space from edges)

Source
padding_right
Source
padding_right=(padding_right : Int32)
Source
page_down
Source
page_up
Source
reflow

Reflow content for new width without marking dirty Use this during render when width changes to avoid infinite loop

Source
render(buffer : Buffer, clip : Rect) : Nil

Override to render widget content

Source
scroll_down(lines : Int32 = 1) : Nil
Source
scroll_left(cols : Int32 = -1) : Nil

Horizontal scrolling

Source
scroll_right(cols : Int32 = -1) : Nil
Source
scroll_speed

Vertical scroll speed (lines per wheel event)

Source
scroll_speed=(scroll_speed : Int32)

Vertical scroll speed (lines per wheel event)

Source
scroll_to_bottom
Source
scroll_to_bottom_on_next_render

Schedule scroll to bottom for next render (when rect is valid) Used when loading sessions to scroll to end after layout

Source
scroll_to_left
Source
scroll_to_right
Source
scroll_to_top
Source
scroll_up(lines : Int32 = 1) : Nil

Scrolling

Source
scroll_y

Scroll accessors for external control

Source
scroll_y=(value : Int32)
Source
select_all
Source
selected_text

Get selected text as plain text

Source
selection_bg
Source
selection_bg=(selection_bg : Color)
Source
set_content_silent(markdown : String) : Nil

Set content without marking dirty (for use during render/cache population) This prevents infinite render loops when creating cached views

Source
start_streaming

Start streaming mode

Source
stop_streaming

End streaming mode

Source
streaming=(streaming : Bool)
Source
streaming?
Source
strikethrough_style
Source
strikethrough_style=(strikethrough_style : Style)
Source
table_border_style
Source
table_border_style=(table_border_style : Style)
Source
table_cell_style
Source
table_cell_style=(table_cell_style : Style)
Source
table_header_style
Source
table_header_style=(table_header_style : Style)
Source
text_style
Source
text_style=(text_style : Style)
Source
toggle_details(details_id : String) : Nil

Toggle details expanded/collapsed state

Source

Nested types