-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3205f8
commit 35cf4b6
Showing
16 changed files
with
633 additions
and
517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Boolean Functions | ||
|
||
## `eqFold` *string1* *string2* [*extraStrings*...] | ||
|
||
`eqFold` returns the boolean truth of comparing *string1* with *string2* | ||
and any number of *extraStrings* under Unicode case-folding. | ||
|
||
```text | ||
{{ eqFold "föö" "FOO" }} | ||
true | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Conversion Functions | ||
|
||
## `fromJSON` *jsontext* | ||
|
||
`fromJSON` parses *jsontext* as JSON and returns the parsed value. | ||
|
||
```text | ||
{{ `{ "foo": "bar" }` | fromJSON }} | ||
``` | ||
|
||
## `hexDecode` *hextext* | ||
|
||
`hexDecode` returns the bytes represented by *hextext*. | ||
|
||
```text | ||
{{ hexDecode "666f6f626172" }} | ||
foobar | ||
``` | ||
|
||
## `hexEncode` *string* | ||
|
||
`hexEncode` returns the hexadecimal encoding of *string*. | ||
|
||
```text | ||
{{ hexEncode "foobar" }} | ||
666f6f626172 | ||
``` | ||
|
||
## `toJSON` *input* | ||
|
||
`toJSON` returns a JSON string representation of *input*. | ||
|
||
```text | ||
{{ list "foo" "bar" "baz" }} | ||
["foo","bar","baz"] | ||
``` | ||
|
||
## `toString` *input* | ||
|
||
`toString` returns the string representation of *input*. | ||
|
||
```text | ||
{{ toString 10 }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# List Functions | ||
|
||
## `join` *delimiter* *list* | ||
|
||
`join` returns a string containing each item in *list* joined with *delimiter*. | ||
|
||
```text | ||
{{ list "foo" "bar" "baz" | join "," }} | ||
foo,bar,baz | ||
``` | ||
|
||
## `list` *items*... | ||
|
||
`list` creates a new list containing *items*. | ||
|
||
```text | ||
{{ list "foo" "bar" "baz" }} | ||
``` | ||
|
||
## `prefixLines` *prefix* *list* | ||
|
||
`prefixLines` returns a string consisting of each item in *list* | ||
with the prefix *prefix*. | ||
|
||
```text | ||
{{ list "this is" "a multi-line" "comment" | prefixLines "# " }} | ||
# this is | ||
# a multi-line | ||
# comment | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# String Functions | ||
|
||
## `contains` *substring* *string* | ||
|
||
`contains` returns whether *substring* is in *string*. | ||
|
||
```text | ||
{{ "abc" | contains "ab" }} | ||
true | ||
``` | ||
|
||
## `hasPrefix` *prefix* *string* | ||
|
||
`hasPrefix` returns whether *string* begins with *prefix*. | ||
|
||
```text | ||
{{ "foobar" | hasPrefix "foo" }} | ||
true | ||
``` | ||
|
||
## `hasSuffix` *suffix* *string* | ||
|
||
`hasSuffix` returns whether *string* ends with *suffix*. | ||
|
||
```text | ||
{{ "foobar" | hasSuffix "bar" }} | ||
true | ||
``` | ||
|
||
## `quote` *input* | ||
|
||
`quote` returns a double-quoted string literal containing *input*. | ||
*input* can be a string or list of strings. | ||
|
||
```text | ||
{{ "foobar" | quote }} | ||
"foobar" | ||
``` | ||
|
||
## `regexpReplaceAll` *pattern* *replacement* *string* | ||
|
||
`regexpReplaceAll` replaces all instances of *pattern* | ||
with *replacement* in *string*. | ||
|
||
```text | ||
{{ "foobar" | regexpReplaceAll "o*b" "" }} | ||
far | ||
``` | ||
|
||
## `toLower` *string* | ||
|
||
`toLower` returns *string* with all letters converted to lower case. | ||
|
||
```text | ||
{{ toLower "FOOBAR" }} | ||
foobar | ||
``` | ||
|
||
## `toUpper` *string* | ||
|
||
`toUpper` returns *string* with all letters converted to upper case. | ||
|
||
```text | ||
{{ toUpper "foobar" }} | ||
FOOBAR | ||
``` | ||
|
||
## `trimSpace` *string* | ||
|
||
`trimSpace` returns *string* with all spaces removed. | ||
|
||
```text | ||
{{ " foobar " | trimSpace }} | ||
foobar | ||
``` |
Oops, something went wrong.