docs(templates): explicitly mention OSC8

relates to #5138
This commit is contained in:
Jan De Dobbeleer 2024-06-21 16:10:02 +02:00 committed by Jan De Dobbeleer
parent 85233aab0b
commit 0d94f1ceb7

View file

@ -171,16 +171,16 @@ use them.
<!-- markdownlint-disable MD013 -->
| Template | Description |
| -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `{{ url .UpstreamIcon .UpstreamURL }}` | Create a hyperlink to a website to open your default browser (needs terminal [support][terminal-list-hyperlinks]). |
| `{{ path .Path .Location }}` | Create a link to a folder to open your file explorer (needs terminal [support][terminal-list-hyperlinks]). |
| `{{ secondsRound 3600 }}` | Round seconds to a time indication. In this case the output is `1h`. |
| `{{ if glob "*.go" }}OK{{ else }}NOK{{ end }}` | Exposes [filepath.Glob][glob] as a boolean template function. |
| `{{ if matchP "*.Repo" .Path }}Repo{{ else }}No Repo{{ end }}` | Exposes [regexp.MatchString][regexpms] as a boolean template function. |
| `{{ replaceP "c.t" "cut code cat" "dog" }}` | Exposes [regexp.ReplaceAllString][regexpra] as a string template function. |
| <code>\{\{ .Code &vert; hresult \}\}</code> | Transform a status code to its HRESULT value for easy troubleshooting. For example `-1978335212` becomes `0x8A150014`. |
| `{{ readFile ".version.json" }}` | Read a file in the current directory. Returns a string. |
| Template | Description |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `{{ url .UpstreamIcon .UpstreamURL }}` | Create an `OSC8` hyperlink to a website to open your default browser (needs terminal [support][terminal-list-hyperlinks]). |
| `{{ path .Path .Location }}` | Create an `OSC8` file link to a folder to open your file explorer (needs terminal [support][terminal-list-hyperlinks]). |
| `{{ secondsRound 3600 }}` | Round seconds to a time indication. In this case the output is `1h`. |
| `{{ if glob "*.go" }}OK{{ else }}NOK{{ end }}` | Exposes [filepath.Glob][glob] as a boolean template function. |
| `{{ if matchP "*.Repo" .Path }}Repo{{ else }}No Repo{{ end }}` | Exposes [regexp.MatchString][regexpms] as a boolean template function. |
| `{{ replaceP "c.t" "cut code cat" "dog" }}` | Exposes [regexp.ReplaceAllString][regexpra] as a string template function. |
| <code>\{\{ .Code &vert; hresult \}\}</code> | Transform a status code to its HRESULT value for easy troubleshooting. For example `-1978335212` becomes `0x8A150014`. |
| `{{ readFile ".version.json" }}` | Read a file in the current directory. Returns a string. |
<!-- markdownlint-enable MD013 -->