Documentation ¶
Overview ¶
Package formatting provides formatting configuration section for slogtxt theme configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Format ¶
type Format struct { Prefix string `yaml:"prefix,omitempty"` Suffix string `yaml:"suffix,omitempty"` Style Style `yaml:"style"` }
Format contains prefix, suffix and style, each is optional.
type Item ¶
type Item struct { Outer Format `yaml:"outer"` Inner Format `yaml:"inner"` Separator StyledText `yaml:"separator,omitempty"` Text string `yaml:"text,omitempty"` }
Item is an item inside formatting section.
type Level ¶
type Level struct { All Item `yaml:"all"` Debug Item `yaml:"debug"` Info Item `yaml:"info"` Warning Item `yaml:"warning"` Error Item `yaml:"error"` }
Level is a log level formatting configuration.
type ModePatch ¶ added in v0.6.0
type ModePatch struct { Mode sgr.Mode Action sgr.ModeAction }
ModePatch is a patch for a mode.
func (ModePatch) MarshalText ¶ added in v0.6.0
MarshalText returns a text representation of p.
func (*ModePatch) UnmarshalText ¶ added in v0.6.0
UnmarshalText parses text and stores the result in p.
type ModePatchList ¶ added in v0.6.0
type ModePatchList []ModePatch
ModePatchList is a list of mode patches.
func (ModePatchList) Sets ¶ added in v0.6.0
func (l ModePatchList) Sets() [3]sgr.ModeSet
Sets returns an array of mode sets for actions sgr.ModeAdd, sgr.ModeRemove and sgr.ModeToggle.
func (ModePatchList) UpdatedBy ¶ added in v0.6.0
func (l ModePatchList) UpdatedBy(other ModePatchList) ModePatchList
UpdatedBy returns a copy of l updated by other.
type Style ¶
type Style struct { Background sgr.Color `yaml:"background,omitempty"` Foreground sgr.Color `yaml:"foreground,omitempty"` Modes ModePatchList `yaml:"modes,omitempty"` }
Style includes background color, foreground color and a set of modes. Modes overwrites current set of modes during style rendering. So, explicitly specifying empty list of modes will disable all currently enabled modes.
type StyledText ¶ added in v0.6.0
StyledText is a text with style.
func (StyledText) UpdatedBy ¶ added in v0.6.0
func (t StyledText) UpdatedBy(other StyledText) StyledText
UpdatedBy returns a copy of t updated by other.