Documentation
¶
Overview ¶
This package handles styled strings. It can strip styling from strings and it can turn a styled string into a series of screen cells. Some global variables can be used to configure how various things are rendered.
Index ¶
Constants ¶
View Source
const BACKSPACE = '\b'
Variables ¶
View Source
var ManPageBold = twin.StyleDefault.WithAttr(twin.AttrBold)
View Source
var ManPageHeading = twin.StyleDefault.WithAttr(twin.AttrBold)
View Source
var ManPageUnderline = twin.StyleDefault.WithAttr(twin.AttrUnderline)
Functions ¶
func WithoutFormatting ¶
func WithoutFormatting(s string, lineNumber *linenumbers.LineNumber) string
Types ¶
type StyledRunesWithTrailer ¶ added in v1.27.2
type StyledRunesWithTrailer struct { StyledRunes []twin.StyledRune Trailer twin.Style }
func StyledRunesFromString ¶ added in v1.27.2
func StyledRunesFromString(prefix string, s string, lineNumber *linenumbers.LineNumber) StyledRunesWithTrailer
Turn a (formatted) string into a series of screen cells
The prefix will be prepended to the string before parsing. The lineNumber is used for error reporting.
type UnprintableStyleT ¶
type UnprintableStyleT int
How do we render unprintable characters?
const ( UnprintableStyleHighlight UnprintableStyleT = iota UnprintableStyleWhitespace )
var UnprintableStyle UnprintableStyleT
Click to show internal directories.
Click to hide internal directories.