Documentation
¶
Overview ¶
Package glamour provides markdown help rendering for cmdguard CLIs. It is an optional module — import it only when you want styled markdown help output, to avoid pulling in chroma, goldmark, and bluemonday.
Usage:
import (
v3 "github.com/larsartmann/cmdguard/v3/pkg/cmdguard/v3"
"github.com/larsartmann/cmdguard/glamour"
)
cli, _ := v3.NewCLI[Config]("app", "My app", Config{},
glamour.WithHelp[T](),
)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderMarkdown ¶
RenderMarkdown renders markdown to styled terminal output using glamour. Uses environment-based theme detection. On error, the original markdown is returned.
func RenderMarkdownWithTheme ¶
RenderMarkdownWithTheme renders markdown with a specific glamour theme.
func WithHelp ¶
WithHelp enables markdown rendering for command help text. When enabled, the Long and Example fields of all commands are rendered through glamour for styled terminal output. The theme is determined by the GLAMOUR_STYLE environment variable, defaulting to "dark".
func WithHelpTheme ¶
WithHelpTheme enables markdown rendering with a specific glamour theme. Supported themes: "ascii", "dark", "dracula", "light", "notty", "pink", "tokyo-night".
Types ¶
This section is empty.