markdown

package
v0.79.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package markdown wraps Glamour for cached markdown-to-ANSI rendering with width-based revalidation, falling back to plain text wrapping for narrow terminals.

Index

Constants

View Source
const (
	// MinWidthForMarkdown is the minimum terminal width for markdown rendering.
	// Below this, falls back to plain text wrapping.
	MinWidthForMarkdown = 30

	// MaxCacheEntries is the maximum number of cached renders before eviction.
	MaxCacheEntries = 100
)

Variables

This section is empty.

Functions

func WrapText

func WrapText(text string, maxWidth int) []string

WrapText wraps text to fit within maxWidth. Used as fallback when terminal is too narrow for markdown rendering.

Types

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer wraps Glamour for markdown rendering with caching.

func NewRenderer

func NewRenderer() (*Renderer, error)

NewRenderer creates a new markdown renderer instance.

func (*Renderer) RenderContent

func (r *Renderer) RenderContent(content string, width int) []string

RenderContent renders markdown content to styled lines.

Jump to

Keyboard shortcuts

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