1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-01-14 02:23:16 +02:00
chroma/formatter.go

19 lines
430 B
Go

package chroma
import (
"io"
)
// A Formatter for Chroma lexers.
type Formatter interface {
// Format returns a formatting function for tokens.
Format(w io.Writer, style *Style) (func(*Token), error)
}
// A FormatterFunc is a Formatter implemented as a function.
type FormatterFunc func(io.Writer, *Style) (func(*Token), error)
func (f FormatterFunc) Format(w io.Writer, s *Style) (func(*Token), error) {
return f(w, s)
}