mirror of https://github.com/gohugoio/hugo
1.0 KiB
1.0 KiB
title | description | categories | keywords | |
---|---|---|---|---|
Syntax highlighting styles | Highlight code examples using one of these styles. |
|
Overview
Hugo provides several methods to add syntax highlighting to code examples:
- Use the
transform.Highlight
function within your templates - Use the
highlight
shortcode with any content format - Use fenced code blocks with the Markdown content format
Regardless of method, use any of the syntax highlighting styles below.
Set the default syntax highlighting style in your site configuration:
{{< code-toggle file=hugo >}} [markup.highlight] style = 'monokai' {{< /code-toggle >}}
See configure Markup.
Styles
This gallery demonstrates the application of each syntax highlighting style with code examples written in different programming languages.
{{% syntax-highlighting-styles %}}