Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.
sourcegraphPublic archive

About

Go HTTP client for syntect_server

Topics

Resources

Stars

5 stars

Watchers

13 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

Repository files navigation

gosyntect

gosyntect is now part of the Sourcegraph monorepo.

The information below is preserved for archival purposes only.

gosyntect is a Go HTTP client for syntect_server, a Rust HTTP server which syntax highlights code.

Installation

go get -u github.com/sourcegraph/gosyntect/cmd/gosyntect

Usage

usage: gosyntect <server> <theme> <file.go>

example:
	gosyntect http://localhost:9238 'InspiredGitHub' gosyntect.go

API

client := gosyntect.New("http://localhost:9238")
resp, err := cl.Highlight(&gosyntect.Query{
	Extension: "go",
	Theme:     "InspiredGitHub",
	Code:      string(theGoCode),
})
if err != nil {
	log.Fatal(err)
}
fmt.Println(resp.Data) // prints highlighted HTML

About

Go HTTP client for syntect_server

Topics

Resources

Stars

5 stars

Watchers

13 watching

Forks

Releases

Packages

Used by

Contributors

Languages