render

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package render provides output renderers for fo's visualization patterns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSON

type JSON struct{}

JSON renders patterns as structured JSON for automation.

func NewJSON

func NewJSON() *JSON

NewJSON creates a JSON renderer.

func (*JSON) Render

func (j *JSON) Render(patterns []pattern.Pattern) string

Render formats all patterns as JSON.

type LLM

type LLM struct{}

LLM renders patterns as terse plain text optimized for AI consumption. Zero ANSI codes, deterministic sort, SCOPE line, importance-budgeted truncation.

func NewLLM

func NewLLM() *LLM

NewLLM creates an LLM renderer.

func (*LLM) Render

func (l *LLM) Render(patterns []pattern.Pattern) string

Render formats all patterns for LLM consumption.

type Renderer

type Renderer interface {
	Render(patterns []pattern.Pattern) string
}

Renderer converts patterns to formatted output.

type Terminal

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

Terminal renders patterns as styled terminal output via lipgloss.

func NewTerminal

func NewTerminal(theme Theme, width int) *Terminal

NewTerminal creates a terminal renderer with the given theme.

func (*Terminal) Render

func (t *Terminal) Render(patterns []pattern.Pattern) string

Render formats all patterns for terminal display.

type Theme

type Theme struct {
	Name    string
	Primary lipgloss.Style
	Success lipgloss.Style
	Warning lipgloss.Style
	Error   lipgloss.Style
	Muted   lipgloss.Style
	Bold    lipgloss.Style
	Icons   ThemeIcons
}

Theme defines colors and icons for terminal rendering.

func DefaultTheme

func DefaultTheme() Theme

DefaultTheme returns a vibrant color theme.

func MonoTheme

func MonoTheme() Theme

MonoTheme returns a monochrome theme (no colors).

func OrcaTheme

func OrcaTheme() Theme

OrcaTheme returns a muted, professional theme.

func ThemeByName

func ThemeByName(name string) Theme

ThemeByName returns a theme by name, defaulting to DefaultTheme.

type ThemeIcons

type ThemeIcons struct {
	Pass   string
	Fail   string
	Warn   string
	Info   string
	WIP    string
	Bullet string
}

ThemeIcons defines the icon set for a theme.

Jump to

Keyboard shortcuts

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