Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d4l3k/go-highlight
A Go (Golang) code syntax highlighting library.
https://github.com/d4l3k/go-highlight
golang highlight syntax-highlighting
Last synced: about 1 month ago
JSON representation
A Go (Golang) code syntax highlighting library.
- Host: GitHub
- URL: https://github.com/d4l3k/go-highlight
- Owner: d4l3k
- License: mit
- Created: 2016-11-18T21:03:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-31T09:15:08.000Z (almost 8 years ago)
- Last Synced: 2024-12-21T04:42:16.235Z (about 1 month ago)
- Topics: golang, highlight, syntax-highlighting
- Language: Go
- Homepage:
- Size: 340 KB
- Stars: 23
- Watchers: 4
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-highlight [![GoDoc](https://godoc.org/github.com/d4l3k/go-highlight?status.svg)](https://godoc.org/github.com/d4l3k/go-highlight) [![Build Status](https://travis-ci.org/d4l3k/go-highlight.svg?branch=master)](https://travis-ci.org/d4l3k/go-highlight)
A Go (Golang) code syntax highlighting library. It uses automatically converted
[highlight.js](https://github.com/isagalaev/highlight.js) language definitions.## Usage
```go
package mainimport "github.com/d4l3k/go-highlight"
func main() {
highlight.Highlight("go", `
package mainimport "fmt"
func main() {
fmt.Println("Duck!")
}
`)
/*
package mainimport "fmt"
func main() {
fmt.Println("Duck!")
}
*/
}
```## Copyright
The code written by Tristan Rice is licensed under the MIT license.
The language definitions are ported from
[highlight.js](https://github.com/isagalaev/highlight.js) which is licensed
under the BSD licence.