From d8fa10e6ebceab465bbc915a86e1ec2102c17f8b Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Wed, 29 Jan 2025 09:51:34 -0800 Subject: [PATCH] string functions --- .../templates/hcl_templates/functions/string/chomp.mdx | 4 ++-- .../templates/hcl_templates/functions/string/format.mdx | 5 ++--- .../hcl_templates/functions/string/formatlist.mdx | 5 ++--- .../templates/hcl_templates/functions/string/indent.mdx | 6 +++--- .../templates/hcl_templates/functions/string/join.mdx | 6 +++--- .../templates/hcl_templates/functions/string/lower.mdx | 6 +++--- .../templates/hcl_templates/functions/string/regex.mdx | 6 +++--- .../hcl_templates/functions/string/regex_replace.mdx | 9 ++------- .../hcl_templates/functions/string/regexall.mdx | 4 ++-- .../templates/hcl_templates/functions/string/replace.mdx | 5 ++--- .../templates/hcl_templates/functions/string/split.mdx | 5 ++--- .../hcl_templates/functions/string/strcontains.mdx | 6 +++--- .../templates/hcl_templates/functions/string/strrev.mdx | 4 ++-- .../templates/hcl_templates/functions/string/substr.mdx | 6 +++--- .../templates/hcl_templates/functions/string/title.mdx | 6 +++--- .../templates/hcl_templates/functions/string/trim.mdx | 6 +++--- .../hcl_templates/functions/string/trimprefix.mdx | 6 +++--- .../hcl_templates/functions/string/trimspace.mdx | 6 +++--- .../hcl_templates/functions/string/trimsuffix.mdx | 6 +++--- .../templates/hcl_templates/functions/string/upper.mdx | 6 +++--- 20 files changed, 52 insertions(+), 61 deletions(-) diff --git a/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx b/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx index 9586ab280..47a13b06d 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/chomp.mdx @@ -1,6 +1,6 @@ --- -page_title: chomp - Functions - Configuration Language -description: The chomp function removes newline characters at the end of a string. +page_title: chomp function reference +description: The `chomp` function removes newline characters at the end of a string. Learn how to use the `chomp` function in Packer templates. --- # `chomp` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/format.mdx b/website/content/docs/templates/hcl_templates/functions/string/format.mdx index 7ac645ffe..569c0e3ab 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/format.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/format.mdx @@ -1,8 +1,7 @@ --- -page_title: format - Functions - Configuration Language +page_title: format function reference description: |- - The format function produces a string by formatting a number of other values - according to a specification string. + The `format` function applies a specification to format values and produce a new string. Learn how to use the `format` function in Packer templates. --- # `format` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx b/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx index 6d110ae20..8503de8c4 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/formatlist.mdx @@ -1,8 +1,7 @@ --- -page_title: formatlist - Functions - Configuration Language +page_title: formatlist function reference description: |- - The formatlist function produces a list of strings by formatting a number of - other values according to a specification string. + The `formatlist` function applies a specification to format values and produce a list of strings. Learn how to use the `formatlist` function in Packer templates. --- # `formatlist` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/indent.mdx b/website/content/docs/templates/hcl_templates/functions/string/indent.mdx index 158a22a49..d68a7970b 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/indent.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/indent.mdx @@ -1,8 +1,8 @@ --- -page_title: indent - Functions - Configuration Language +page_title: indent function reference description: |- - The indent function adds a number of spaces to the beginnings of all but the - first line of a given multi-line string. + The `indent` function adds spaces to the beginnings of all but the + first line of a given multi-line string. Learn how to use the `indent` function in Packer templates. --- # `indent` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/join.mdx b/website/content/docs/templates/hcl_templates/functions/string/join.mdx index acdbaa8ae..d8c4de04e 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/join.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/join.mdx @@ -1,8 +1,8 @@ --- -page_title: join - Functions - Configuration Language +page_title: join function reference description: |- - The join function produces a string by concatenating the elements of a list - with a given delimiter. + The `join` function produces a string by concatenating the elements of a list + with a given delimiter. Learn how to use the `join` function in Packer templates. --- # `join` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/lower.mdx b/website/content/docs/templates/hcl_templates/functions/string/lower.mdx index 654824822..39c3a5df7 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/lower.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/lower.mdx @@ -1,8 +1,8 @@ --- -page_title: lower - Functions - Configuration Language +page_title: lower function reference description: >- - The lower function converts all cased letters in the given string to - lowercase. + The `lower` function converts all uppercase letters in the given string to + lowercase. Learn how to use the `lower` function in Packer templates. --- # `lower` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/regex.mdx b/website/content/docs/templates/hcl_templates/functions/string/regex.mdx index 74d55a647..6cce4356c 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regex.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regex.mdx @@ -1,8 +1,8 @@ --- -page_title: regex - Functions - Configuration Language +page_title: regex function reference description: |- - The regex function applies a regular expression to a string and returns the - matching substrings. + The `regex` function applies a regular expression to a string and returns the + matching substrings. Learn how to use the `regex` function in Packer templates. --- # `regex` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx b/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx index 29d10b8e0..cbfb66a68 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regex_replace.mdx @@ -1,12 +1,7 @@ --- -page_title: regex_replace - Functions - Configuration Language +page_title: regex_replace function reference description: >- - The regex_replace function searches a given string for another given - substring, - - and replaces all occurrences with a given replacement string. The substring - - argument can be a valid regular expression or a string. + The `regex_replace` function matches and replaces all occurrences of a substring with a replacement string. Learn how to use the `regex_replace` function in Packer templates. --- # `regex_replace` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx b/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx index 969006981..0e2d500f9 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/regexall.mdx @@ -1,7 +1,7 @@ --- -page_title: regexall - Functions - Configuration Language +page_title: regexall function reference description: |- - The regexall function applies a regular expression to a string and returns a list of all matches. + The `regexall` function applies a regular expression to a string and returns a list of all matches. Learn how to use the `regexall` function in Packer templates. --- # `regexall` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/replace.mdx b/website/content/docs/templates/hcl_templates/functions/string/replace.mdx index 4097756f9..5ffd43ba3 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/replace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/replace.mdx @@ -1,8 +1,7 @@ --- -page_title: replace - Functions - Configuration Language +page_title: replace function reference description: |- - The replace function searches a given string for another given substring, - and replaces all occurrences with a given replacement string. + The `replace` function replaces all occurrences of substring with a given string. Learn how to use the `replace` function in Packer templates. --- # `replace` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/split.mdx b/website/content/docs/templates/hcl_templates/functions/string/split.mdx index 677b10a92..eaa43d537 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/split.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/split.mdx @@ -1,8 +1,7 @@ --- -page_title: split - Functions - Configuration Language +page_title: split function reference description: |- - The split function produces a list by dividing a given string at all - occurrences of a given separator. + The `split` function divides the given string according to the specified separator to produce a list. Learn how to use the `split` function in Packer templates. --- # `split` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx b/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx index ea3389c37..2a1cfbbdc 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/strcontains.mdx @@ -1,12 +1,12 @@ --- -page_title: strcontains - Functions - Configuration Language +page_title: strcontains function reference description: |- - The strcontains function checks whether a given string can be found within another string. + The `strcontains` function searches for a substring within a string. Learn how to use the `strcontains` function in Packer templates. --- # `strcontains` Function -`strcontains` function checks whether a substring is within another string. +The `strcontains` function searches for a substring within a string. ```hcl strcontains(string, substr) diff --git a/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx b/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx index c543bfeb9..49639de4f 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/strrev.mdx @@ -1,6 +1,6 @@ --- -page_title: strrev - Functions - Configuration Language -description: The strrev function reverses a string. +page_title: strrev function reference +description: The `strrev` function reverses a string. Learn how to use the `strrev` function in Packer templates. --- # `strrev` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/substr.mdx b/website/content/docs/templates/hcl_templates/functions/string/substr.mdx index 594feb28e..76693b463 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/substr.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/substr.mdx @@ -1,8 +1,8 @@ --- -page_title: substr - Functions - Configuration Language +page_title: substr function reference description: |- - The substr function extracts a substring from a given string by offset and - length. + The `substr` function extracts a substring from a given string using an offset and + length. Learn how to use the `substr` function in Packer templates. --- # `substr` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/title.mdx b/website/content/docs/templates/hcl_templates/functions/string/title.mdx index 15d40f3d0..475e76581 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/title.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/title.mdx @@ -1,8 +1,8 @@ --- -page_title: title - Functions - Configuration Language +page_title: title function reference description: |- - The title function converts the first letter of each word in a given string - to uppercase. + The `title` function converts the first letter of each word in a given string + to uppercase. Learn how to use the `title` function in Packer templates. --- # `title` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trim.mdx b/website/content/docs/templates/hcl_templates/functions/string/trim.mdx index 321a46eac..e0e240857 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trim.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trim.mdx @@ -1,8 +1,8 @@ --- -page_title: trim - Functions - Configuration Language +page_title: trim function reference description: |- - The trim function removes the specified characters from the start and end of - a given string. + The `trim` function removes the specified characters from the start and end of + a given string. Learn how to use the `trim` function in Packer templates. --- # `trim` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx index f9396edc0..bbe3b3af3 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimprefix.mdx @@ -1,8 +1,8 @@ --- -page_title: trimprefix - Functions - Configuration Language +page_title: trimprefix function reference description: |- - The trimprefix function removes the specified prefix from the start of a - given string. + The `trimprefix` function removes the specified prefix from the start of a + given string. Learn how to use the `trimprefix` function in Packer templates. --- # `trimprefix` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx index a1f619083..01fba86c3 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimspace.mdx @@ -1,8 +1,8 @@ --- -page_title: trimspace - Functions - Configuration Language +page_title: trimspace function reference description: |- - The trimspace function removes space characters from the start and end of - a given string. + The `trimspace` function removes space characters from the start and end of + a given string. Learn how to use the `trimpsace` function in Packer templates. --- # `trimspace` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx b/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx index e69644ca3..ad17dcd57 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/trimsuffix.mdx @@ -1,8 +1,8 @@ --- -page_title: trimsuffix - Functions - Configuration Language +page_title: trimsuffix function reference description: |- - The trimsuffix function removes the specified suffix from the end of a - given string. + The `trimsuffix` function removes the specified suffix from the end of a + given string. Learn how to use the `trimsuffix` function in Packer templates. --- # `trimsuffix` Function diff --git a/website/content/docs/templates/hcl_templates/functions/string/upper.mdx b/website/content/docs/templates/hcl_templates/functions/string/upper.mdx index 7a6bb0a5b..2219cc073 100644 --- a/website/content/docs/templates/hcl_templates/functions/string/upper.mdx +++ b/website/content/docs/templates/hcl_templates/functions/string/upper.mdx @@ -1,8 +1,8 @@ --- -page_title: upper - Functions - Configuration Language +page_title: upper function reference description: >- - The upper function converts all cased letters in the given string to - uppercase. + The `upper` function converts all lowercase letters in the given string to + uppercase. Learn how to use the `upper` function in Packer templates. --- # `upper` Function