Documentation
¶
Index ¶
- func ListThemes() []string
- type Attributes
- type Cell
- type TermRenderer
- func (r *TermRenderer) Render() (image.Image, error)
- func (r *TermRenderer) WithArgs(args []string) *TermRenderer
- func (r *TermRenderer) WithAutoSize() *TermRenderer
- func (r *TermRenderer) WithFont(font *fonts.Font) *TermRenderer
- func (r *TermRenderer) WithFontName(name string, style *fonts.FontStyle) *TermRenderer
- func (r *TermRenderer) WithFontSize(size float64) *TermRenderer
- func (r *TermRenderer) WithHeight(height int) *TermRenderer
- func (r *TermRenderer) WithLineHeight(height float64) *TermRenderer
- func (r *TermRenderer) WithPadding(left, right, top, bottom int) *TermRenderer
- func (r *TermRenderer) WithPromptFunc(promptFunc func(command string) string) *TermRenderer
- func (r *TermRenderer) WithShowPrompt() *TermRenderer
- func (r *TermRenderer) WithTerminalSize(fd uintptr) *TermRenderer
- func (r *TermRenderer) WithTheme(theme string) *TermRenderer
- func (r *TermRenderer) WithWidth(width int) *TermRenderer
- type TermStyle
- type Terminal
- type Theme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attributes ¶
type TermRenderer ¶
type TermRenderer struct {
Output []byte
Style *TermStyle
// contains filtered or unexported fields
}
func DefaultRenderer ¶
func DefaultRenderer(input []byte) *TermRenderer
func NewRenderer ¶
func NewRenderer(input []byte, style *TermStyle) *TermRenderer
func (*TermRenderer) WithArgs ¶
func (r *TermRenderer) WithArgs(args []string) *TermRenderer
func (*TermRenderer) WithAutoSize ¶
func (r *TermRenderer) WithAutoSize() *TermRenderer
func (*TermRenderer) WithFont ¶
func (r *TermRenderer) WithFont(font *fonts.Font) *TermRenderer
func (*TermRenderer) WithFontName ¶
func (r *TermRenderer) WithFontName(name string, style *fonts.FontStyle) *TermRenderer
func (*TermRenderer) WithFontSize ¶
func (r *TermRenderer) WithFontSize(size float64) *TermRenderer
func (*TermRenderer) WithHeight ¶
func (r *TermRenderer) WithHeight(height int) *TermRenderer
func (*TermRenderer) WithLineHeight ¶
func (r *TermRenderer) WithLineHeight(height float64) *TermRenderer
func (*TermRenderer) WithPadding ¶
func (r *TermRenderer) WithPadding(left, right, top, bottom int) *TermRenderer
func (*TermRenderer) WithPromptFunc ¶
func (r *TermRenderer) WithPromptFunc(promptFunc func(command string) string) *TermRenderer
func (*TermRenderer) WithShowPrompt ¶
func (r *TermRenderer) WithShowPrompt() *TermRenderer
func (*TermRenderer) WithTerminalSize ¶
func (r *TermRenderer) WithTerminalSize(fd uintptr) *TermRenderer
func (*TermRenderer) WithTheme ¶
func (r *TermRenderer) WithTheme(theme string) *TermRenderer
func (*TermRenderer) WithWidth ¶
func (r *TermRenderer) WithWidth(width int) *TermRenderer
type TermStyle ¶
type TermStyle struct {
Args []string // Command and arguments
Theme string // The terminal theme to use
Font *fonts.Font // The font to use
FontSize float64 // The font size in points
LineHeight float64 // The line height multiplier
PaddingLeft int // Padding between the code and the left edge
PaddingRight int // Padding between the code and the right edge
PaddingTop int // Padding between the code and the top edge
PaddingBottom int // Padding between the code and the bottom edge
Width int // Terminal width in cells
Height int // Terminal height in cells
AutoSize bool // Whether to automatically size the output to the content
CellSpacing int // Additional horizontal spacing between cells
ShowPrompt bool // Whether to show a prompt
PromptFunc func(command string) string // Template function that returns the prompt text
}
type Terminal ¶
type Terminal struct {
Cells [][]Cell
Width int
Height int
CursorX int
CursorY int
CurrAttrs Attributes
CurrFg color.Color
CurrBg color.Color
Style *Theme // Theme colors from theme
MaxX int // For dynamic sizing
MaxY int // For dynamic sizing
DefaultFg color.Color
DefaultBg color.Color
AutoSize bool // Whether to automatically size the terminal
PaddingLeft int
PaddingRight int
PaddingTop int
PaddingBottom int
}
func NewTerminal ¶
type Theme ¶
type Theme struct {
Name string `yaml:"name"`
Author string `yaml:"author"`
Variant string `yaml:"variant"`
// Standard colors (0-7)
Color01 string `yaml:"color_01"` // Black
Color02 string `yaml:"color_02"` // Red
Color03 string `yaml:"color_03"` // Green
Color04 string `yaml:"color_04"` // Yellow
Color05 string `yaml:"color_05"` // Blue
Color06 string `yaml:"color_06"` // Magenta
Color07 string `yaml:"color_07"` // Cyan
Color08 string `yaml:"color_08"` // White
// Bright colors (8-15)
Color09 string `yaml:"color_09"` // Bright Black
Color10 string `yaml:"color_10"` // Bright Red
Color11 string `yaml:"color_11"` // Bright Green
Color12 string `yaml:"color_12"` // Bright Yellow
Color13 string `yaml:"color_13"` // Bright Blue
Color14 string `yaml:"color_14"` // Bright Magenta
Color15 string `yaml:"color_15"` // Bright Cyan
Color16 string `yaml:"color_16"` // Bright White
// Special colors
Background string `yaml:"background"`
Foreground string `yaml:"foreground"`
Cursor string `yaml:"cursor"`
}
Theme represents a terminal color theme
func (*Theme) GetBackground ¶
GetBackground returns the theme's background color
func (*Theme) GetForeground ¶
GetForeground returns the theme's foreground color
Click to show internal directories.
Click to hide internal directories.