Merge commit 'cb39847dee488c373dd5bc2a3706385342a59355'

This commit is contained in:
Bjørn Erik Pedersen
2020-08-14 18:31:40 +02:00
15 changed files with 34 additions and 29 deletions

View File

@@ -16,14 +16,12 @@ aliases: [/extras/highlighting/,/extras/highlight/,/tools/syntax-highlighting/]
toc: true
---
Hugo uses [Chroma](https://github.com/alecthomas/chroma) as its code highlighter; it is built in Go and is really, really fast -- and for the most important parts compatible with Pygments we used before.
## Configure Syntax Highlighter
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.
@@ -36,7 +34,6 @@ hugo gen chromastyles --style=monokai > syntax.css
Run `hugo gen chromastyles -h` for more options. See https://xyproto.github.io/splash/docs/ for a gallery of available styles.
## Highlight Shortcode
Highlighting is carried out via the [built-in shortcode](/content-management/shortcodes/) `highlight`. `highlight` takes exactly one required parameter for the programming language to be highlighted and requires a closing shortcode. Note that `highlight` is *not* used for client-side javascript highlighting.
@@ -80,8 +77,6 @@ func GetTitleFunc(style string) func(s string) string {
}
{{< / highlight >}}
## Highlight Template Func
See [Highlight](/functions/highlight/).