1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
# pp [](https://app.wercker.com/project/bykey/6934c847631da2cf672e559f927a90b2)
Colored pretty printer for Go language

## Usage
Just call `pp.Print()`.
```go
import "github.com/k0kubun/pp"
m := map[string]string{"foo": "bar", "hello": "world"}
pp.Print(m)
```

### API
fmt package-like functions are provided.
```go
pp.Print()
pp.Println()
pp.Sprint()
pp.Fprintf()
// ...
```
API doc is available at: http://godoc.org/github.com/k0kubun/pp
### Custom colors
If you require, you may change the colors (all or some) for syntax highlighting:
```go
// Create a struct describing your scheme
scheme := pp.ColorScheme{
Integer: pp.Green | pp.Bold,
Float: pp.Black | pp.BackgroundWhite | pp.Bold,
String: pp.Yellow,
}
// Register it for usage
pp.SetColorScheme(scheme)
```
Look into ColorScheme struct for the field names.
If you would like to revert to the default highlighting, you may do so by calling `pp.ResetColorScheme()`.
Out of the following color flags, you may combine any color with a background color and optionally with the bold parameter. Please note that bold will likely not work on the windows platform.
```go
// Colors
Black
Red
Green
Yellow
Blue
Magenta
Cyan
White
// Background colors
BackgroundBlack
BackgroundRed
BackgroundGreen
BackgroundYellow
BackgroundBlue
BackgroundMagenta
BackgroundCyan
BackgroundWhite
// Other
Bold
// Special
NoColor
```
## Demo
### Timeline

### UserStream event

### Works on windows

## License
MIT License
|