mirror of
https://github.com/alecthomas/chroma.git
synced 2025-09-16 09:16:32 +02:00
@@ -205,21 +205,18 @@ func main() {
|
|||||||
style, err := builder.Build()
|
style, err := builder.Build()
|
||||||
ctx.FatalIfErrorf(err)
|
ctx.FatalIfErrorf(err)
|
||||||
|
|
||||||
|
if cli.Formatter == "html" {
|
||||||
|
configureHTMLFormatter(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
// Dump styles.
|
// Dump styles.
|
||||||
if cli.HTMLStyles {
|
if cli.HTMLStyles {
|
||||||
options := []html.Option{html.WithClasses(true)}
|
formatter := formatters.Get("html").(*html.Formatter)
|
||||||
if cli.HTMLAllStyles {
|
|
||||||
options = append(options, html.WithAllClasses(true))
|
|
||||||
}
|
|
||||||
formatter := html.New(options...)
|
|
||||||
err = formatter.WriteCSS(w, style)
|
err = formatter.WriteCSS(w, style)
|
||||||
ctx.FatalIfErrorf(err)
|
ctx.FatalIfErrorf(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if cli.Formatter == "html" {
|
|
||||||
configureHTMLFormatter(ctx)
|
|
||||||
}
|
|
||||||
if len(cli.Files) == 0 {
|
if len(cli.Files) == 0 {
|
||||||
var contents string
|
var contents string
|
||||||
var lexer chroma.Lexer
|
var lexer chroma.Lexer
|
||||||
|
Reference in New Issue
Block a user