From d966f5d08d7f75f1ae9acd94e292bf61de2adf0d Mon Sep 17 00:00:00 2001 From: Helder Pereira Date: Sat, 21 Aug 2021 11:46:18 +0100 Subject: [PATCH] highlight: Remove some pygments references --- commands/genchromastyles.go | 6 +++--- docs/content/en/content-management/formats.md | 1 - docs/content/en/content-management/shortcodes.md | 1 - docs/content/en/content-management/syntax-highlighting.md | 2 +- docs/content/en/functions/highlight.md | 2 -- docs/content/en/getting-started/installing.md | 1 - hugolib/config.go | 1 - hugolib/embedded_shortcodes_test.go | 4 ++-- hugolib/shortcode_test.go | 4 ++-- markup/blackfriday/renderer.go | 2 +- 10 files changed, 9 insertions(+), 15 deletions(-) diff --git a/commands/genchromastyles.go b/commands/genchromastyles.go index 53fb2be6..a2476ffd 100644 --- a/commands/genchromastyles.go +++ b/commands/genchromastyles.go @@ -37,9 +37,9 @@ func createGenChromaStyles() *genChromaStyles { 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`, }), } @@ -47,7 +47,7 @@ See https://help.farbox.com/pygments.html for preview of 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)") diff --git a/docs/content/en/content-management/formats.md b/docs/content/en/content-management/formats.md index 5654be7f..1ae20ba5 100644 --- a/docs/content/en/content-management/formats.md +++ b/docs/content/en/content-management/formats.md @@ -152,7 +152,6 @@ Markdown syntax is simple enough to learn in a single sitting. The following are [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/ diff --git a/docs/content/en/content-management/shortcodes.md b/docs/content/en/content-management/shortcodes.md index ce3bcd1f..d65b9d3b 100644 --- a/docs/content/en/content-management/shortcodes.md +++ b/docs/content/en/content-management/shortcodes.md @@ -435,7 +435,6 @@ To learn more about creating custom shortcodes, see the [shortcode template docu [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/ diff --git a/docs/content/en/content-management/syntax-highlighting.md b/docs/content/en/content-management/syntax-highlighting.md index c0c43cfa..31f12f7d 100644 --- a/docs/content/en/content-management/syntax-highlighting.md +++ b/docs/content/en/content-management/syntax-highlighting.md @@ -24,7 +24,7 @@ See [Configure Highlight](/getting-started/configuration-markup#highlight). ## 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: diff --git a/docs/content/en/functions/highlight.md b/docs/content/en/functions/highlight.md index 1740742c..159f9160 100644 --- a/docs/content/en/functions/highlight.md +++ b/docs/content/en/functions/highlight.md @@ -22,5 +22,3 @@ deprecated: false [highlight]: /content-management/shortcodes/#highlight -[installpygments]: /getting-started/installing/#installing-pygments-optional -[syntax]: /content-management/syntax-highlighting/ diff --git a/docs/content/en/getting-started/installing.md b/docs/content/en/getting-started/installing.md index ae3fe7f9..cf1dfed2 100644 --- a/docs/content/en/getting-started/installing.md +++ b/docs/content/en/getting-started/installing.md @@ -552,7 +552,6 @@ Now that you've installed Hugo, read the [Quick Start guide][quickstart] and exp [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 diff --git a/hugolib/config.go b/hugolib/config.go index 945d9eec..aa9c8110 100644 --- a/hugolib/config.go +++ b/hugolib/config.go @@ -278,7 +278,6 @@ func (l configLoader) applyConfigDefaults() error { "disablePathToLower": false, "hasCJKLanguage": false, "enableEmoji": false, - "pygmentsCodeFencesGuessSyntax": false, "defaultContentLanguage": "en", "defaultContentLanguageInSubdir": false, "enableMissingTranslationPlaceholders": false, diff --git a/hugolib/embedded_shortcodes_test.go b/hugolib/embedded_shortcodes_test.go index 53ad2fe8..b56368dd 100644 --- a/hugolib/embedded_shortcodes_test.go +++ b/hugolib/embedded_shortcodes_test.go @@ -104,8 +104,8 @@ void do(); 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 diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 7eb0d01d..6ef110c9 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -619,8 +619,8 @@ title: "Foo" 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) }) diff --git a/markup/blackfriday/renderer.go b/markup/blackfriday/renderer.go index a46e46b5..5d4cab04 100644 --- a/markup/blackfriday/renderer.go +++ b/markup/blackfriday/renderer.go @@ -28,7 +28,7 @@ type hugoHTMLRenderer struct { } // 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")