mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-21 21:17:50 +02:00
17 lines
367 B
Go
17 lines
367 B
Go
package formatters
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
|
|
"github.com/alecthomas/chroma"
|
|
"github.com/alecthomas/chroma/styles"
|
|
)
|
|
|
|
// Tokens formatter outputs the raw token structures.
|
|
var Tokens = Register("tokens", FormatterFunc(func(w io.Writer, s *styles.Style) (func(*chroma.Token), error) {
|
|
return func(token *chroma.Token) {
|
|
fmt.Fprintln(w, token.GoString())
|
|
}, nil
|
|
}))
|