markdown

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package markdown renders GFM (produced by internal/adf) for the TUI and the release-notes plain view through glamour, with a style derived from the active clib theme so issue bodies and comments match the rest of the dashboard. The caching renderer is primer's (identity+width keyed, content-hash invalidated — glamour is too slow to run on every View frame); this package only maps the clib theme onto primer's palette.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorToken added in v0.8.0

func ColorToken(c color.Color) string

ColorToken converts a theme color to the string form glamour accepts. ANSI palette indexes pass through as their index ("4", "212"), so the terminal's own palette renders them exactly like the rest of the chrome — round-tripping an indexed color through RGBA would bake in the standard VGA value and visibly drift from the themed UI around it.

func StyleFromTheme

func StyleFromTheme(t *clibtheme.Theme) ansi.StyleConfig

StyleFromTheme derives a glamour style from the clib palette: headings in the chrome blue (H1 magenta, matching detail headers), links blue, inline code yellow, quotes and rules dim. The base config — which supplies everything not overridden here, notably the code-block chroma palette — follows the theme's declared background so a light theme never renders on glamour's dark defaults. Margins are zeroed — the panes own their padding.

Types

type Renderer

type Renderer = render.MarkdownRenderer

Renderer is a width-aware, cached glamour renderer. Concurrency-safe, though the TUI renders from a single goroutine.

func NewRenderer

func NewRenderer(style ansi.StyleConfig) *Renderer

NewRenderer builds a Renderer with the given glamour style.

Jump to

Keyboard shortcuts

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