baseCmd: newBaseCmd(&cobra.Command{
Use: "chromastyles",
Short: "Generate CSS stylesheet for the Chroma code highlighter",
- Long: `Generate CSS stylesheet for the Chroma code highlighter for a given style. This stylesheet is needed if pygmentsUseClasses is enabled in config.
+ Long: `Generate CSS stylesheet for the Chroma code highlighter for a given style. This stylesheet is needed if markup.highlight.noClasses is disabled in config.
-See https://help.farbox.com/pygments.html for preview of available styles`,
+See https://xyproto.github.io/splash/docs/all.html for a preview of the available styles`,
}),
}
return g.generate()
}
- g.cmd.PersistentFlags().StringVar(&g.style, "style", "friendly", "highlighter style (see https://help.farbox.com/pygments.html)")
+ g.cmd.PersistentFlags().StringVar(&g.style, "style", "friendly", "highlighter style (see https://xyproto.github.io/splash/docs/)")
g.cmd.PersistentFlags().StringVar(&g.highlightStyle, "highlightStyle", "bg:#ffffcc", "style used for highlighting lines (see https://github.com/alecthomas/chroma)")
g.cmd.PersistentFlags().StringVar(&g.linesStyle, "linesStyle", "", "style used for line numbers (see https://github.com/alecthomas/chroma)")
[mmark]: https://github.com/mmarkdown/mmark
[org]: https://orgmode.org/
[pandoc]: https://www.pandoc.org/
-[Pygments]: https://pygments.org/
[rest]: https://docutils.sourceforge.io/rst.html
[sc]: /content-management/shortcodes/
[sct]: /templates/shortcode-templates/
[Instagram]: https://www.instagram.com/
[pagevariables]: /variables/page/
[partials]: /templates/partials/
-[Pygments]: https://pygments.org/
[quickstart]: /getting-started/quick-start/
[sctemps]: /templates/shortcode-templates/
[scvars]: /variables/shortcodes/
## Generate Syntax Highlighter CSS
-If you run with `pygmentsUseClasses=true` in your site config, you need a style sheet.
+If you run with `markup.highlight.noClasses=false` in your site config, you need a style sheet.
You can generate one with Hugo:
[highlight]: /content-management/shortcodes/#highlight
-[installpygments]: /getting-started/installing/#installing-pygments-optional
-[syntax]: /content-management/syntax-highlighting/
[installgo]: https://golang.org/dl/
[linuxbrew]: https://docs.brew.sh/Homebrew-on-Linux
[Path Editor]: https://patheditor2.codeplex.com/
-[pygments]: https://pygments.org
[quickstart]: /getting-started/quick-start/
[redhatforum]: https://discourse.gohugo.io/t/solved-fedora-copr-repository-out-of-service/2491
[releases]: https://github.com/gohugoio/hugo/releases
"disablePathToLower": false,
"hasCJKLanguage": false,
"enableEmoji": false,
- "pygmentsCodeFencesGuessSyntax": false,
"defaultContentLanguage": "en",
"defaultContentLanguageInSubdir": false,
"enableMissingTranslationPlaceholders": false,
th = newTestHelper(cfg, fs, t)
)
- cfg.Set("pygmentsStyle", "bw")
- cfg.Set("pygmentsUseClasses", false)
+ cfg.Set("markup.highlight.style", "bw")
+ cfg.Set("markup.highlight.noClasses", true)
writeSource(t, fs, filepath.Join("content", "simple.md"), fmt.Sprintf(`---
title: Shorty
cfg.Set("uglyURLs", false)
cfg.Set("verbose", true)
- cfg.Set("pygmentsUseClasses", true)
- cfg.Set("pygmentsCodefences", true)
+ cfg.Set("markup.highlight.noClasses", false)
+ cfg.Set("markup.highlight.codeFences", true)
cfg.Set("markup", map[string]interface{}{
"defaultMarkdownHandler": "blackfriday", // TODO(bep)
})
}
// BlockCode renders a given text as a block of code.
-// Pygments is used if it is setup to handle code fences.
+// Chroma is used if it is setup to handle code fences.
func (r *hugoHTMLRenderer) BlockCode(out *bytes.Buffer, text []byte, lang string) {
if r.c.cfg.MarkupConfig.Highlight.CodeFences {
str := strings.Trim(string(text), "\n\r")