Documentation
¶
Index ¶
- Constants
- func EraseAnyWSs(s string) string
- func GetNoColorMode() bool
- func IsTtyEscaped(s string) bool
- func StripEscapes(str string) (strCleaned string)
- func StripHTMLTags(s string) string
- func StripLeftTabs(s string) string
- func StripLeftTabsOnly(s string) string
- func StripQuotes(s string) string
- type ColorTranslator
Constants ¶
View Source
const ( // FgBlack terminal color code FgBlack = 30 // FgRed terminal color code FgRed = 31 // FgGreen terminal color code FgGreen = 32 // FgYellow terminal color code FgYellow = 33 // FgBlue terminal color code FgBlue = 34 // FgMagenta terminal color code FgMagenta = 35 // FgCyan terminal color code FgCyan = 36 // FgLightGray terminal color code FgLightGray = 37 // FgDarkGray terminal color code FgDarkGray = 90 // FgLightRed terminal color code FgLightRed = 91 // FgLightGreen terminal color code FgLightGreen = 92 // FgLightYellow terminal color code FgLightYellow = 93 // FgLightBlue terminal color code FgLightBlue = 94 // FgLightMagenta terminal color code FgLightMagenta = 95 // FgLightCyan terminal color code FgLightCyan = 96 // FgWhite terminal color code FgWhite = 97 // BgNormal terminal color code BgNormal = 0 // BgBoldOrBright terminal color code BgBoldOrBright = 1 // BgDim terminal color code BgDim = 2 // BgItalic terminal color code BgItalic = 3 // BgUnderline terminal color code BgUnderline = 4 // BgUlink terminal color code BgUlink = 5 // BgInverse _ BgInverse = 7 // BgHidden terminal color code BgHidden = 8 // BgStrikeout terminal color code BgStrikeout = 9 // DarkColor terminal color code DarkColor = FgLightGray )
Variables ¶
This section is empty.
Functions ¶
func EraseAnyWSs ¶
EraseAnyWSs eats any whitespaces inside the giving string s.
func GetNoColorMode ¶
func GetNoColorMode() bool
func IsTtyEscaped ¶
IsTtyEscaped detects a string if it contains ansi color escaped sequences
func StripEscapes ¶
StripEscapes removes any ansi color escaped sequences from a string
func StripHTMLTags ¶
StripHTMLTags aggressively strips HTML tags from a string. It will only keep anything between `>` and `<`.
func StripLeftTabs ¶
StripLeftTabs strips the least left side tab chars from lines. StripLeftTabs strips html tags too.
func StripLeftTabsOnly ¶
StripLeftTabsOnly strips the least left side tab chars from lines.
func StripQuotes ¶
StripQuotes strips single or double quotes around a string.
Types ¶
type ColorTranslator ¶
type ColorTranslator interface { Translate(s string, initialFg int) string Colorize(s string, clr int) string }
ColorTranslator _
func GetStockedCPT ¶ added in v1.1.0
func GetStockedCPT() ColorTranslator
func NewCPT ¶ added in v1.1.0
func NewCPT() ColorTranslator
func NewCPTNoColor ¶ added in v1.1.0
func NewCPTNoColor() ColorTranslator
Click to show internal directories.
Click to hide internal directories.