File: README.md

package info (click to toggle)
golang-github-x86kernel-htmlcolor 0.0~git20190529.c589f58-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 56 kB
  • sloc: makefile: 2
file content (34 lines) | stat: -rw-r--r-- 531 bytes parent folder | download
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
# htmlcolor

Html syntax highlighter for Go

## Installation

```
go get github.com/x86kernel/htmlcolor
```

## Example Code


``` go
package main

import (
        "bytes"
        "fmt"
        
        "github.com/x86kernel/htmlcolor"
)

func main() {
        htmlformatter := htmlcolor.NewFormatter()

        testhtml := []byte("<html>\n<head>\n<body>\n</body>\n</head>\n</html>")

        buffer := bytes.NewBuffer(make([]byte, len(testhtml)))
        htmlformatter.Format(buffer, testhtml)

        fmt.Println(buffer)
}
```