mbtui
mbtui renders mbdown documents directly to native Ratatui text and media
placements. It supports
Unicode-aware layout, tables, syntax-highlighted code blocks, semantic styles,
hashtags, wikilinks, file embeds, inline math, terminal-native display math, boxes, and
responsive columns without an ANSI round trip. Invalid or over-wide formulas
fall back to a tex source block. The default Theme uses the Catppuccin Mocha
palette.
Renderer::render returns RenderedDocument: its text contains stable blank
rows reserved for CommonMark images, while images describes each source, alt
text, and terminal-cell rectangle after Box, alignment, indentation, and column
layout. Its owned front_matter field exposes parsed YAML/TOML source and its
original byte span even though front matter is hidden from text by default.
Use Renderer::with_front_matter(true) to render it as a labeled metadata
block. Applications own image loading and terminal-protocol rendering.
The semantics field reports each Hashtag, WikiLink, and non-image Embed with its document-level
source span and one or more terminal-cell regions. Regions already include
wrapping and Box, alignment, indentation, padding, table, and column offsets,
so downstream applications can add interaction without inferring meaning from
colors or reparsing rendered text.
Bordered boxes and table outer corners can use square or rounded glyphs:
use ;
let theme = default.with_corner_style;
let rendered = with_theme
.with_image_height
.render;
assert_eq!;
# Ok::
See the MBDown 0.1 Language Specification for the core language and its backend-neutral syntax tree.