Documentation
¶
Overview ¶
Package markdownviewer renders a small markdown subset to a styled terminal block with theme tokens. Headings, paragraphs, bullet lists, blockquotes, code blocks, inline code, bold, italic, links, and a horizontal rule. No tables, no nesting, no images.
The viewer is a Bubble Tea model with a scrollable viewport. Up/Down scroll one line. PgUp/PgDn scroll a window. Home/End jump.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Viewer ¶
type Viewer struct {
// contains filtered or unexported fields
}
Viewer is a Bubble Tea model that renders a markdown string to a scrollable terminal block.
func (Viewer) Source ¶ added in v0.38.0
Source returns the current markdown string. Used by nook's mdpreview pane to re-feed source after recreating the viewer with a new theme.
func (Viewer) TotalLines ¶
TotalLines is the count of rendered (post-wrap) lines.
func (Viewer) View ¶
View renders the markdown source as a slice of `height` lines starting at `offset`. Trailing space is preserved so callers can compose the block with a border.
func (Viewer) WithSize ¶
WithSize sets the rendered width and visible-row height. Minimums are enforced so the layout never collapses.
func (Viewer) WithSource ¶
WithSource sets the markdown string. Offset resets to 0.
