Documentation
¶
Overview ¶
Package pterm cmd/skywire-cli/cliutil/pterm/pterm_js.go c5-cli-util
js/wasm implementation of the shadow: plain ANSI SGR codes and a simple box-drawing tree renderer, no pterm import (pterm's keyboard dependency does not build for js). Output is functionally equivalent for the color and tree surface the CLI uses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Red = func(a ...interface{}) string { return sgr("31", a...) } Green = func(a ...interface{}) string { return sgr("32", a...) } Blue = func(a ...interface{}) string { return sgr("34", a...) } Cyan = func(a ...interface{}) string { return sgr("36", a...) } Magenta = func(a ...interface{}) string { return sgr("35", a...) } Yellow = func(a ...interface{}) string { return sgr("33", a...) } White = func(a ...interface{}) string { return sgr("37", a...) } Black = func(a ...interface{}) string { return sgr("30", a...) } )
Sprint-style color functions.
View Source
var ( BgRed = Style{"41"} BgBlue = Style{"44"} BgMagenta = Style{"45"} )
Background styles.
View Source
var DefaultTree = TreePrinter{}
DefaultTree is the zero-config tree printer.
Functions ¶
Types ¶
type LeveledListItem ¶
LeveledListItem is one indentation-leveled line.
type Style ¶
type Style struct {
// contains filtered or unexported fields
}
Style is a background style; its Sprint wraps arguments in the SGR code.
type TreePrinter ¶
type TreePrinter struct {
// contains filtered or unexported fields
}
TreePrinter renders a TreeNode with box-drawing branches.
func (TreePrinter) WithRoot ¶
func (t TreePrinter) WithRoot(n TreeNode) *TreePrinter
WithRoot returns a printer for the given root.
Click to show internal directories.
Click to hide internal directories.