1
0
mirror of https://github.com/go-task/task.git synced 2025-06-02 23:27:37 +02:00

docs: move yaml templating functions to the correct section

This commit is contained in:
Pete Davison 2025-04-28 20:57:18 +00:00
parent fc17343fcc
commit d1bfd3e9f7
No known key found for this signature in database

View File

@ -264,13 +264,15 @@ description here for completeness. For detailed usage, please refer to the
| `toJson`\* | Encodes an object as a JSON string. |
| `toPrettyJson`\* | Encodes an object as a JSON string with new lines and indentation. |
| `toRawJson`\* | Encodes an object as a JSON string with HTML characters unescaped. |
| `fromYaml`\* | Decodes a YAML string into an object. |
| `toYaml`\* | Encodes an object as a YAML string. |
| `b64enc` | Encodes a string into base 64. |
| `b64dec` | Decodes a string from base 64. |
| `b32enc` | Encodes a string into base 32. |
| `b32dec` | Decodes a string from base 32. |
:::note
YAML encoding functions are [provided directly by Task](#task-functions).
:::
#### [List Functions][list-functions]
| Function | Description |
@ -338,6 +340,10 @@ description here for completeness. For detailed usage, please refer to the
| `osExt` | Returns the file extension of a filepath. |
| `osIsAbs` | Checks if a filepath is absolute. |
:::note
More filepath encoding functions are [provided directly by Task](#task-functions).
:::
#### [Flow Control Functions][flow-control-functions]
| Function | Description |
@ -377,7 +383,7 @@ Lastly, Task itself provides a few functions:
| Function | Description |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `OS` | Returns the operating system. Possible values are `windows`, `linux`, `darwin` (macOS) and `freebsd`. |
| `ARCH` | Returns the architecture Task was compiled to: `386`, `amd64`, `arm` or `s390x`. |
| `ARCH` | Returns the architecture Task was compiled to: `386`, `amd64`, `arm` or `s390x`. |
| `numCPU` | Returns the number of logical CPU's usable by the current process. |
| `splitLines` | Splits Unix (`\n`) and Windows (`\r\n`) styled newlines. |
| `catLines` | Replaces Unix (`\n`) and Windows (`\r\n`) styled newlines with a space. |
@ -390,6 +396,8 @@ Lastly, Task itself provides a few functions:
| `relPath` | Converts an absolute path (second argument) into a relative path, based on a base path (first argument). The same as Go's [filepath.Rel](https://pkg.go.dev/path/filepath#Rel). |
| `merge` | Creates a new map that is a copy of the first map with the keys of each subsequent map merged into it. If there is a duplicate key, the value of the last map with that key is used. |
| `spew` | Returns the Go representation of a specific variable. Useful for debugging. Uses the [davecgh/go-spew](https://github.com/davecgh/go-spew) package. |
| `fromYaml`\* | Decodes a YAML string into an object. |
| `toYaml`\* | Encodes an object as a YAML string. |
{/* prettier-ignore-start */}
[text/template]: https://pkg.go.dev/text/template