Files
tai/research/tui-framework-design/bubbletea-glamour-example.md
T
2026-10-12 00:53:52 +02:00

2.1 KiB

bubbletea examples/glamour — markdown rendering width math

Metadata

Field Value
Institute Molodetz Institute — Research & Retrieval Division
Subject tui-framework-design
Document type Source Dossier
Tier 1
Source title bubbletea examples/glamour/main.go — Glamour markdown example
Source URL https://raw.githubusercontent.com/charmbracelet/bubbletea/main/examples/glamour/main.go
Source publisher / author Charm (bubbletea project)
Source type repository
Source date (published) Unknown — not stated
Date researched 2026-10-11
Researched by tai (agent), model: Muse Spark, on behalf of retoor
Research method direct page fetch
Confidence Medium
Status Active

Summary

Charm's markdown-in-a-viewport example: content is rendered through the Glamour markdown renderer into a viewport, with the render width computed as viewport width minus frame size minus a 3-column gutter, and dark/light style auto-detected. A thin source; the width formula is the finding.

Key findings

  • Markdown is rendered via the Glamour renderer into a scrollable viewport (static content, not streaming).
  • Render width equals viewport width minus frame size minus a 3-column gutter; dark/light style is auto-detected.

Pros / strengths

  • The width-minus-chrome formula is exactly the rule tai's markdown renderer needs, from the framework authors.
  • Demonstrates that markdown belongs in the transcript viewport, not in a separate pane.

Cons / limitations / caveats

  • Static markdown only: no streaming or incremental re-render behavior to learn from.
  • Glamour itself is a Go library; tai needs a native equivalent, not this code.

Relevance to tai

  • Supplies the markdown width-minus-chrome rule adopted in the messaging-layout conclusion (markdown for assistant content, rendered at viewport width minus frame and gutter).

Changelog

Date Change
2026-10-11 Initial dossier created from 2026-10-11 research-pass evidence (body opened via web_fetch by researching agent).