https://github.com/koki-develop/annotate-go
🎨 A Go library for rendering annotated source code with line numbers and labeled markers.
https://github.com/koki-develop/annotate-go
Last synced: 26 days ago
JSON representation
🎨 A Go library for rendering annotated source code with line numbers and labeled markers.
- Host: GitHub
- URL: https://github.com/koki-develop/annotate-go
- Owner: koki-develop
- License: mit
- Created: 2026-03-18T03:03:20.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-03-23T13:46:58.000Z (about 1 month ago)
- Last Synced: 2026-03-28T00:45:39.717Z (about 1 month ago)
- Language: Go
- Homepage:
- Size: 103 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# annotate-go
A Go library for rendering annotated source code with line numbers and labeled markers.
## Installation
```sh
go get github.com/koki-develop/annotate-go
```
## Usage
```go
src := []byte(`name = "Alice"
age = 30
`)
labels := []annotate.Label{
{Span: annotate.Span{Start: 0, End: 4}, Marker: annotate.MarkerDash, Text: "string field"},
{Span: annotate.Span{Start: 15, End: 18}, Marker: annotate.MarkerTilde, Text: "integer field"},
}
r := annotate.New()
output, _ := r.Render(src, labels)
fmt.Print(output)
```
```
1 | name = "Alice"
| ---- string field
2 | age = 30
| ~~~ integer field
```
See [pkg.go.dev](https://pkg.go.dev/github.com/koki-develop/annotate-go) for full API documentation.
## License
[MIT](./LICENSE)