glamour

package module
v0.1.0 Latest Latest
Warning

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

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

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

func RenderMarkdown(markdown string) string

RenderMarkdown renders markdown to styled terminal output using glamour. Uses environment-based theme detection. On error, the original markdown is returned.

func RenderMarkdownWithTheme

func RenderMarkdownWithTheme(markdown, theme string) string

RenderMarkdownWithTheme renders markdown with a specific glamour theme.

func WithHelp

func WithHelp() v3.CLIOption

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

func WithHelpTheme(theme string) v3.CLIOption

WithHelpTheme enables markdown rendering with a specific glamour theme. Supported themes: "ascii", "dark", "dracula", "light", "notty", "pink", "tokyo-night".

Types

This section is empty.

Jump to

Keyboard shortcuts

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