package style
Import Path
github.com/carapace-sh/carapace/pkg/style (on go.dev)
Dependency Relation
imports 4 packages, and imported by 11 packages
Involved Source Files
config.go
keyword.go
loglevel.go
path.go
Package style provide display coloring
Package-Level Type Names (only one)
( Context) Abs(s string) (string, error)
( Context) Getenv(key string) string
( Context) LookupEnv(key string) (string, bool)
github.com/carapace-sh/carapace/pkg/traverse.Context (interface)
github.com/carapace-sh/carapace/pkg/uid.Context (interface)
github.com/carapace-sh/carapace.Context
Context : github.com/carapace-sh/carapace/pkg/traverse.Context
Context : github.com/carapace-sh/carapace/pkg/uid.Context
func ForExtension(path string, sc Context) string
func ForKeyword(s string, _ Context) string
func ForLogLevel(s string, _ Context) string
func ForPath(path string, sc Context) string
func ForPathExt(path string, sc Context) string
Package-Level Functions (total 12)
ForExtension returns the style for given extension
json
ForKeyword returns the style for given keyword.
ForLogLevel returns the style for given log level.
ForPath returns the style for given path
/tmp/locally/reachable/file.txt
ForPath returns the style for given path by extension only
/tmp/non/existing/file.txt
Of combines different styles.
Register a style configuration
var Carapace = struct {
Value string `description:"default style for values"`
Description string `description:"default style for descriptions"`
}{
Value: Default,
Description: Gray,
}
func init() {
Register("carapace", &Carapace)
}
Set a style
Set("carapace.Value", "bold magenta")
SGR returns the SGR sequence for given style.
TrueColor returns a 24-bit true color.
XTerm256Color returns a color from the xterm 256-color palette.
Package-Level Variables (total 40)
var BgBrightBlack string var BgBrightBlue string var BgBrightCyan string var BgBrightGreen string var BgBrightRed string var BgBrightWhite string var BgBrightYellow string var BrightBlack string var BrightBlue string var BrightCyan string var BrightGreen string var BrightMagenta string var BrightWhite string var BrightYellow string var Underlined string
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |