TUI::MarkdownView
Inherits TUI::Scrollable < Reference < Object
Renders a Markdown source string: numbered headings with per-level emphasis (since a terminal can't grow font size), real word-wrapped paragraphs/list items/blockquotes preserving inline styling, nested list indentation with continuation lines aligned under the text (not the marker), and GFM tables with alignment-aware column widths drawn with box-drawing borders. Parsing/wrapping/layout are hand-rolled in TUI::Markdown (this library has zero runtime dependencies) — see TUI::Markdown::Parser/Wrap/Layout for the algorithms; this class is just the Scrollable host: styling properties, caching, and the standard scroll-key handling every other Scrollable already has.
Constructors
Instance methods
Reports the physical row count for the width this content was LAST
actually rendered at (#render_content updates that width every
call) — Window#render calls #content_size before it has built the
buffer that would tell content this frame's width (confirmed by
reading Window#render: total = @content.content_size runs before
inner = Buffer.new(inner_width, ...)), so there is structurally
no way to answer for the CURRENT frame's width here. This is stale
by exactly one frame during an active resize (used only for
Scroller#clamp's max-offset math) and self-heals the same frame
#render_content next runs with the real width — the same
resize-tolerance philosophy Scroller#clamp itself already relies
on, rather than widening Scrollable's abstract contract for this
one widget's benefit.
A positional (mouse) event, pre-translated by Window into content-local row/col (0,0 = content's own first cell).
Everything but positional mouse hit-testing.
Heading styles by level (index 0 = h1), decreasing emphasis since Style has no font-size — numbering (see #number_headings) is the primary way level is conveyed, this is a secondary visual cue.
Heading styles by level (index 0 = h1), decreasing emphasis since Style has no font-size — numbering (see #number_headings) is the primary way level is conveyed, this is a secondary visual cue.
Replaces the rendered content and invalidates the cached layout (see #content_size for why layout is cached at all) so the next #content_size/#render_content call re-lays-out unconditionally, even if the new document happens to need the same width as the old cached layout.
Nested-outline numbering ("1.2.3 Title") in front of every heading. Disable to keep indentation/styling but drop the prefix.
Nested-outline numbering ("1.2.3 Title") in front of every heading. Disable to keep indentation/styling but drop the prefix.
Render into buffer, a region already sized to the content area
(border/scrollbar column already excluded by Window). Row 0 is
content's own first row.
Set by a host app (e.g. to a document's filename); shown as the hosting Window's border title, same convention as DetailView#title.