Code highlighting

content
Render code with a syntax highlighter.

Code highlighting can be used with the Hugo highlight function. The highlight function uses the Chroma syntax highlighter, supporting over 200 languages with more than 40 available styles.

See an HTML example below:

1<head>
2  <meta charset="utf-8">
3  <meta http-equiv="X-UA-Compatible" content="IE=edge">
4  <meta name="viewport" content="width=device-width, initial-scale=1">
5  <link rel="stylesheet" href="/assets/css/main.css">
6  <link rel="shortcut icon" type="image/png" href="/assets/img/favicon.png" >
7  <script src="/assets/js/main.js"></script>
8</head>