quick

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package quick provides simple, no-configuration source code highlighting.

Example
package main

import (
	"log"
	"os"

	"github.com/alecthomas/chroma/quick"
)

func main() {
	code := `package main

func main() { }
`
	err := quick.Highlight(os.Stdout, code, "go", "html", "monokai")
	if err != nil {
		log.Fatal(err)
	}
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Highlight

func Highlight(w io.Writer, source, lexer, formatter, style string) error

Highlight some text.

Lexer, formatter and style may be empty, in which case a best-effort is made.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL