Skip to content

Commit 31fe6dc

Browse files
authored
Merge pull request #1873 from TerryHowe/claude/update-function-list-docs-011CUoHWZBJyBZSoeppqiVUE
docs: Add mustToToml function documentation
2 parents 90acf5f + c56e31b commit 31fe6dc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/chart_template_guide/function_list.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ The following type conversion functions are provided by Helm:
706706
- `fromJsonArray`: Convert a JSON array to a list.
707707
- `toYaml`: Convert list, slice, array, dict, or object to indented yaml, can be used to copy chunks of yaml from any source. This function is equivalent to GoLang yaml.Marshal function, see docs here: https://pkg.go.dev/gopkg.in/yaml.v2#Marshal
708708
- `toYamlPretty`: Convert list, slice, array, dict, or object to indented yaml. Equivalent to `toYaml` but will additionally indent lists by 2 spaces.
709-
- `toToml`: Convert list, slice, array, dict, or object to toml, can be used to copy chunks of toml from any source.
709+
- `toToml` (`mustToToml`): Convert list, slice, array, dict, or object to toml, can be used to copy chunks of toml from any source.
710710
- `fromYamlArray`: Convert a YAML array to a list.
711711

712712
Only `atoi` requires that the input be a specific type. The others will attempt
@@ -876,6 +876,18 @@ greeting: |
876876
{{ end }}
877877
```
878878

879+
### toToml, mustToToml
880+
881+
The `toToml` function encodes an item into a TOML string. If the item cannot be
882+
converted to TOML the function will return an empty string. `mustToToml` will
883+
return an error in case the item cannot be encoded in TOML.
884+
885+
```
886+
toToml .Item
887+
```
888+
889+
The above returns TOML string representation of `.Item`.
890+
879891
880892
## Regular Expressions
881893

0 commit comments

Comments
 (0)