markdown

package
v1.2.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(text string) string

Normalize cleans up markdown for terminal rendering.

func Render

func Render(text string, wrap int) string

Render renders markdown text to ANSI with the given wrap width.

func Renderer

func Renderer(wrap int) *glamour.TermRenderer

Renderer returns a cached glamour.TermRenderer for the given wrap width.

func StyleConfig

func StyleConfig() ansi.StyleConfig

StyleConfig returns the glamour style config adapted for dark/light terminal. Uses COLORFGBG environment variable instead of termenv.HasDarkBackground() to avoid blocking terminal queries (OSC 11) that deadlock the Bubble Tea event loop on the first render. See: termenv.HasDarkBackground → BackgroundColor → termStatusReport → waitForData blocks forever because Bubble Tea's input reader consumes the response before termenv can read it.

func StyleConfigForDarkMode

func StyleConfigForDarkMode(dark bool) ansi.StyleConfig

func Warmup

func Warmup()

Warmup pre-initializes the glamour markdown renderer so the first real render is fast. Call this during startup (before the TUI event loop) to avoid blocking the first View() call with parser/renderer init.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL