Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Understand background colors ClrHasDarkBG = lipgloss.HasDarkBackground(os.Stdin, os.Stdout) ClrLightDark = lipgloss.LightDark(ClrHasDarkBG) // Base colors ClrBlack = lipgloss.Color("#171e21") ClrBlue = lipgloss.Color("#0087ff") ClrGreen = lipgloss.Color("#009900") ClrOrange = lipgloss.Color("#ffa500") ClrPurple = lipgloss.Color("#8700ff") ClrRed = lipgloss.Color("#cc0000") ClrWhite = lipgloss.Color("#ffffff") ClrYellow = lipgloss.Color("#ffff00") // Meanings (logging) ClrFatal = ClrRed ClrError = ClrRed ClrWarn = ClrOrange ClrInfo = ClrBlue ClrDebug = ClrPurple // Meanings (success) ClrFailure = ClrRed ClrSuccess = ClrGreen // Inline styles change based on background StyleInlineHighlight = lipgloss.NewStyle(). Foreground(ClrLightDark(ClrBlue, ClrYellow)) // Base styles for backgrounds StyleFailure = lipgloss.NewStyle(). Foreground(ClrWhite). Background(ClrFailure) StyleSuccess = lipgloss.NewStyle(). Foreground(ClrWhite). Background(ClrSuccess) StyleDebug = lipgloss.NewStyle(). Foreground(ClrWhite). Background(ClrDebug) StyleInfo = lipgloss.NewStyle(). Foreground(ClrWhite). Background(ClrInfo) StyleWarn = lipgloss.NewStyle(). Foreground(ClrBlack). Background(ClrWarn) StyleError = lipgloss.NewStyle(). Foreground(ClrWhite). Background(ClrError) )
var KeyBindings = KeyMap{ Up: key.NewBinding( key.WithKeys("up", "k"), key.WithHelp("↑/k", "move up"), ), Down: key.NewBinding( key.WithKeys("down", "j"), key.WithHelp("↓/j", "move down"), ), Help: key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "toggle help"), ), Enter: key.NewBinding( key.WithKeys("enter"), key.WithHelp("enter", "make selection"), ), Quit: key.NewBinding( key.WithKeys("q", "esc", "ctrl+c"), key.WithHelp("q/esc", "quit"), ), }
KeyBindings are the standard/default keybindings for the application.
Functions ¶
func BaseOuterTableStyle ¶
BaseOuterTableStyle returns a lipgloss style for the outer border of a table.
func DefaultTableStyles ¶
DefaultTableStyles sets the default styles for a Bubbletea table. Set the values to the table with `t.SetStyles(s)`.
func ExampleText ¶
ExampleText returns formatting that is appropriate for CLI examples.
func GetLoggerStyles ¶
func LongHelpText ¶
LongHelpText returns a styled string with a rounded border and padding. It also allows you to ignore indentation. This is the standardized style for Northwood Labs CLI help text.
func VCS ¶
VCS reads data from the Go build info and returns the value of a specific key. Useful for pre-setting things like the VCS URL, build date, etc.
func VersionScreen ¶
Types ¶
type KeyMap ¶
type KeyMap struct {
Up key.Binding
Down key.Binding
Help key.Binding
Enter key.Binding
Quit key.Binding
}
keyMap defines a set of keybindings. To work for help it must satisfy key.Map. It could also very easily be a map[string]key.Binding.