smelt.layout¶
Tier: Host — Available in every runtime, including headless mode.
Composable block layout (vbox/hbox/leaf/diff/file_view) for tool render callbacks.
smelt.layout.diff¶
Inline-diff render directive — the worker renders the diff directly into the block buffer. opts.old, opts.new are the before/after strings; opts.path picks syntax via extension; opts.anchor (defaults to opts.old) is the diff-view anchor; opts.lang overrides path-based syntax.
smelt.layout.file_view¶
Syntax-highlighted file-view render directive — single line-number column, no diff bg. opts.content is the source text; opts.path picks syntax via extension; opts.lang overrides path-based syntax.
smelt.layout.hbox¶
Lay items out horizontally. Each entry is either a layout userdata (defaults to fill weight 1) or { layout, cols=N } / { layout, weight=N } for a fixed-column or weighted slot.
smelt.layout.leaf¶
Wrap a Buf handle (or raw buf id) into a leaf block layout that renders the buffer's contents in place.
smelt.layout.markdown¶
Build a leaf layout from a markdown string. Common pattern for render
callbacks that want full block-level markdown (headings, fenced code,
lists, tables) instead of plain dim body text.
smelt.layout.sep¶
Build a 1×1 leaf from a single glyph. Auto-repeats to fill the parent's
axis: sep("│") in an hbox = vertical divider, sep("─") in a vbox = horizontal.
smelt.layout.text¶
Build a leaf layout from a string. Common pattern for render callbacks.
smelt.layout.vbox¶
Stack items vertically into a single block layout. Each item must be a layout userdata produced by layout.leaf/layout.vbox/layout.hbox/layout.diff/layout.file_view.