1# pp [![wercker status](https://app.wercker.com/status/fc5308fe78e92594f7ea09b67a486caf/s/master "wercker status")](https://app.wercker.com/project/byKey/fc5308fe78e92594f7ea09b67a486caf) 2 3Colored pretty printer for Go language 4 5![](http://i.gyazo.com/d3253ae839913b7239a7229caa4af551.png) 6 7## Usage 8 9Just call `pp.Print()`. 10 11```go 12import "github.com/k0kubun/pp" 13 14m := map[string]string{"foo": "bar", "hello": "world"} 15pp.Print(m) 16``` 17 18![](http://i.gyazo.com/0d08376ed2656257627f79626d5e0cde.png) 19 20### API 21 22fmt package-like functions are provided. 23 24```go 25pp.Print() 26pp.Println() 27pp.Sprint() 28pp.Fprintf() 29// ... 30``` 31 32API doc is available at: http://godoc.org/github.com/k0kubun/pp 33 34### Custom colors 35 36If you require, you may change the colors (all or some) for syntax highlighting: 37 38```go 39// Create a struct describing your scheme 40scheme := pp.ColorScheme{ 41 Integer: pp.Green | pp.Bold, 42 Float: pp.Black | pp.BackgroundWhite | pp.Bold, 43 String: pp.Yellow, 44} 45 46// Register it for usage 47pp.SetColorScheme(scheme) 48``` 49 50Look into ColorScheme struct for the field names. 51 52If you would like to revert to the default highlighting, you may do so by calling `pp.ResetColorScheme()`. 53 54Out 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. 55 56```go 57// Colors 58Black 59Red 60Green 61Yellow 62Blue 63Magenta 64Cyan 65White 66 67// Background colors 68BackgroundBlack 69BackgroundRed 70BackgroundGreen 71BackgroundYellow 72BackgroundBlue 73BackgroundMagenta 74BackgroundCyan 75BackgroundWhite 76 77// Other 78Bold 79 80// Special 81NoColor 82``` 83 84## Demo 85 86### Timeline 87 88![](http://i.gyazo.com/a8adaeec965db943486e35083cf707f2.png) 89 90### UserStream event 91 92![](http://i.gyazo.com/1e88915b3a6a9129f69fb5d961c4f079.png) 93 94### Works on windows 95 96![](http://i.gyazo.com/ab791997a980f1ab3ee2a01586efdce6.png) 97 98## License 99 100MIT License 101