GitXplorerGitXplorer
d

go-highlight

public
23 stars
9 forks
3 issues

Commits

List of commits on branch master.
Verified
fdfab4a6652c904018a6bc64a9ba79417000dc73

registry: warn on JIT failure instead of fatal

dd4l3k committed 8 years ago
Verified
72273c736df12ad5a31638ca9b24061748b5d2b0

vendor: added go-pcre

dd4l3k committed 8 years ago
Verified
9dec9a5be9bfdeb64e74559dd6acb290d9ab693e

ci: removed deb-src

dd4l3k committed 8 years ago
Verified
fc40d56ce06ad03c46c1e6aa60adde3426f9246a

ci: added xenial sources

dd4l3k committed 8 years ago
Verified
d9d565770738ae5b30a5b596d1303f7b902c0cb3

ci: added libpcre++-dev

dd4l3k committed 8 years ago
Verified
4d222e2dfffa4480d9b414427a453e99d91ccb15

travis: libpcrecpp0 added

dd4l3k committed 8 years ago

README

The README file for this repository.

go-highlight GoDoc Build Status

A Go (Golang) code syntax highlighting library. It uses automatically converted highlight.js language definitions.

Usage

package main

import "github.com/d4l3k/go-highlight"

func main() {
  highlight.Highlight("go", `
    package main

    import "fmt"

    func main() {
      fmt.Println("Duck!")
    }
  `)
  /*
    <keyword>package</keyword> main

    <keyword>import</keyword> <string>"fmt"</string>

    <keyword>func</keyword> main() {
      fmt.Println(<string>"Duck!"</string>)
    }
  */
}

Copyright

The code written by Tristan Rice is licensed under the MIT license.

The language definitions are ported from highlight.js which is licensed under the BSD licence.