Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Sep 24, 2024
1 parent bf2dffe commit 7c97473
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 8 deletions.
35 changes: 35 additions & 0 deletions docs/liquid-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,19 @@ _Example_: `$ca := buildCustomCert "base64-encoded-ca-crt" "base64-encoded-ca-ke
_Implementation_: `github.com/Masterminds/sprig/v3.buildCustomCertificate`

## `camelcase`
Converts a string from snake_case to camelCase.


_Parameters_:

- String to convert




_Example_: `camelcase "http_server"` returns `HttpServer`.



_Implementation_: `github.com/huandu/xstrings.ToPascalCase`

Expand Down Expand Up @@ -1133,11 +1140,18 @@ _Implementation_: `path.IsAbs`
_Implementation_: `github.com/Masterminds/sprig/v3.join`

## `kebabcase`
Converts a string from camelCase to kebab-case.


_Parameters_:

- String to convert




_Example_: `kebabcase "FirstName"` returns `first-name`.



_Implementation_: `github.com/huandu/xstrings.ToKebabCase`
Expand Down Expand Up @@ -2208,10 +2222,17 @@ _Example_: `sha512sum "Hello world!"`.
_Implementation_: `github.com/Masterminds/sprig/v3.sha512sum`

## `shuffle`
Shuffles a string.


_Parameters_:

- String to shuffle




_Example_: `shuffle "hello"`.



Expand All @@ -2228,10 +2249,17 @@ _Implementation_: `github.com/huandu/xstrings.Shuffle`
_Implementation_: `github.com/Masterminds/sprig/v3.slice`

## `snakecase`
Converts a string from camelCase to snake_case.


_Parameters_:

- String to convert




_Example_: `camelcase "FirstName"` returns `first_name`.



Expand Down Expand Up @@ -2318,10 +2346,17 @@ _Implementation_: `github.com/Masterminds/sprig/v3.init.func23`
_Implementation_: `github.com/Masterminds/sprig/v3.substring`

## `swapcase`
Swaps the case of a string using a word based algorithm.


_Parameters_:

- String to convert




_Example_: `swapcase "This Is A.Test"` returns `tHIS iS a.tEST`.



Expand Down
36 changes: 28 additions & 8 deletions template/liquid_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ var functionDocs = map[string]FilterFunctionDocumentation{
Parameters: []string{"Base64 encoded PEM format certificate", "Base64 encoded PEM format private key"},
Example: "`$ca := buildCustomCert \"base64-encoded-ca-crt\" \"base64-encoded-ca-key\"`",
},
"camelcase": {},
"cat": {},
"camelcase": {
Description: "Converts a string from snake_case to camelCase.",
Parameters: []string{"String to convert"},
Example: "`camelcase \"http_server\"` returns `HttpServer`.",
},
"cat": {},
"ceil": {
Description: "Returns greatest float value greater than or equal to input value.",
Parameters: []string{"Input value"},
Expand Down Expand Up @@ -269,8 +273,12 @@ var functionDocs = map[string]FilterFunctionDocumentation{
Description: "Checks whether a path is absolute.",
Parameters: []string{"File path"},
},
"join": {},
"kebabcase": {},
"join": {},
"kebabcase": {
Description: "Converts a string from camelCase to kebab-case.",
Parameters: []string{"String to convert"},
Example: "`kebabcase \"FirstName\"` returns `first-name`.",
},
"keys": {
Description: "Returns list of all keys from a map.",
Parameters: []string{"Map"},
Expand Down Expand Up @@ -471,9 +479,17 @@ var functionDocs = map[string]FilterFunctionDocumentation{
Parameters: []string{"Input value"},
Example: "`sha512sum \"Hello world!\"`.",
},
"shuffle": {},
"slice": {},
"snakecase": {},
"shuffle": {
Description: "Shuffles a string.",
Parameters: []string{"String to shuffle"},
Example: "`shuffle \"hello\"`.",
},
"slice": {},
"snakecase": {
Description: "Converts a string from camelCase to snake_case.",
Parameters: []string{"String to convert"},
Example: "`camelcase \"FirstName\"` returns `first_name`.",
},
"sortAlpha": {},
"split": {},
"splitList": {},
Expand All @@ -482,7 +498,11 @@ var functionDocs = map[string]FilterFunctionDocumentation{
"sub": {},
"subf": {},
"substr": {},
"swapcase": {},
"swapcase": {
Description: "Swaps the case of a string using a word based algorithm.",
Parameters: []string{"String to convert"},
Example: "`swapcase \"This Is A.Test\"` returns `tHIS iS a.tEST`.",
},
"ternary": {
Description: "Takes two values and a test value. If the test value is true, the first value will be returned. If the test value is false, the second value will be returned. This is similar to the C ternary operator.",
Parameters: []string{"First value", "Second value", "Test value"},
Expand Down

0 comments on commit 7c97473

Please sign in to comment.