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 CellsWithTrailer ¶
func CellsFromString ¶
func CellsFromString(prefix string, s string, lineNumber *linenumbers.LineNumber) CellsWithTrailer
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.