Code Highlighting
script-free code syntax highlighting with theme supportUsing a custom pipeline powered by chroma, your HTML templates can include colorized formatted code, with or without line numbers. Hundreds of languages are supported, and the resulting HTML fragment is formatted for clean markup.
For Markdown files, it’s as easy as including a triple-backtick code block with a language specified. It’s used for this document’s code examples.
For go
and HTML Templates, you’ll need to either call one of the utility methods and display the unescaped markup, or use the predefined JSON components.
Golang
1 |
|
HTML Templates
You’ll need to import views/components
at the top of your template.
1 |
|