Andrew Woodlee
4b382bddd9
* Getting environment variables and passwords from Vault (not tested yet) * Vault configuration to config (not tested yet) * Ability to run scripts from file on local machine on the remote host * Ability to get ouput in the notification of a list for individual commands or all commands * Make SSH connections close after all commands have been run; reuse previous connections if needed
67 lines
1.7 KiB
Markdown
67 lines
1.7 KiB
Markdown
+++
|
|
title = "Code highlighting"
|
|
weight = 4
|
|
+++
|
|
|
|
The Relearn theme uses [Hugo's built-in syntax highlighting](https://gohugo.io/content-management/syntax-highlighting/) for code.
|
|
|
|
## Markdown syntax
|
|
|
|
Wrap the code block with three backticks and the name of the language. Highlight will try to auto detect the language if one is not provided.
|
|
|
|
<!-- markdownlint-disable MD046 -->
|
|
````plaintext
|
|
```json
|
|
[
|
|
{
|
|
"title": "apples",
|
|
"count": [12000, 20000],
|
|
"description": {"text": "...", "sensitive": false}
|
|
},
|
|
{
|
|
"title": "oranges",
|
|
"count": [17500, null],
|
|
"description": {"text": "...", "sensitive": false}
|
|
}
|
|
]
|
|
```
|
|
````
|
|
<!-- markdownlint-disable MD046 -->
|
|
|
|
Renders to:
|
|
|
|
```json
|
|
[
|
|
{
|
|
"title": "apples",
|
|
"count": [12000, 20000],
|
|
"description": {"text": "...", "sensitive": false}
|
|
},
|
|
{
|
|
"title": "oranges",
|
|
"count": [17500, null],
|
|
"description": {"text": "...", "sensitive": false}
|
|
}
|
|
]
|
|
```
|
|
|
|
## Supported languages
|
|
|
|
Hugo comes with a [remarkable list](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages) of supported languages.
|
|
|
|
## Recommended configuration
|
|
|
|
You can choose a color theme from the [list of supported themes](https://xyproto.github.io/splash/docs/all.html) and add it in your `config.toml`
|
|
|
|
````toml
|
|
[markup]
|
|
[markup.highlight]
|
|
# if `guessSyntax = true`, there will be no unstyled code even if no language
|
|
# was given BUT Mermaid and Math codefences will not work anymore! So this is a
|
|
# mandatory setting for your site if you want to use Mermaid or Math codefences
|
|
guessSyntax = false
|
|
|
|
# choose a color theme or create your own
|
|
style = "base16-snazzy"
|
|
````
|