Skip to content

Commit

Permalink
feat: improve jp docs (#2018)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
  • Loading branch information
eddycharly authored Sep 26, 2024
1 parent 1a6da5f commit 1701420
Show file tree
Hide file tree
Showing 194 changed files with 1,596 additions and 185 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/go-logr/logr v1.4.2
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/hashicorp/go-getter v1.7.6
github.com/jmespath-community/go-jmespath v1.1.2-0.20240627155901-bdbb290f571e
github.com/jmespath-community/go-jmespath v1.1.2-0.20240919193755-5e4e8ae73c8a
github.com/jstemmer/go-junit-report/v2 v2.1.0
github.com/kudobuilder/kuttl v0.19.0
github.com/kyverno/kyverno-json v0.0.4-0.20240730143747-aade3d42fc0e
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
github.com/jmespath-community/go-jmespath v1.1.2-0.20240627155901-bdbb290f571e h1:e9zkuKm+DRAW1xGu90nokWkxOAWhOPYkMNojmTmtvPE=
github.com/jmespath-community/go-jmespath v1.1.2-0.20240627155901-bdbb290f571e/go.mod h1:YlGIjNhh2pH+qyifSpVtQQIbI8YUoVytgZyKBVAMVX4=
github.com/jmespath-community/go-jmespath v1.1.2-0.20240919193755-5e4e8ae73c8a h1:baQnVszUF+wENqBnqJDlgmSIBpJLMqQE0i+hICMZ9sI=
github.com/jmespath-community/go-jmespath v1.1.2-0.20240919193755-5e4e8ae73c8a/go.mod h1:VL6C6nwf/wRivvXAjziX9yFRVmvOC1qzERc8RTQ0tv4=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
Expand Down
15 changes: 15 additions & 0 deletions website/docs/reference/jp/examples/abs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# abs

## Signature

`abs(number)`

## Description

Returns the absolute value of the provided argument.

## Examples

```
abs(`-1`) == `1`
```
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# add

## Signature

`add(any, any)`

## Description



## Examples

TODO
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/as_string.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# as_string

## Signature

`as_string(any)`

## Description



## Examples

TODO
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/at.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# at

## Signature

`at(array, any)`

## Description



## Examples

TODO
15 changes: 15 additions & 0 deletions website/docs/reference/jp/examples/avg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# avg

## Signature

`avg(array[number])`

## Description

Returns the average of the elements in the provided array. An empty array will produce a return value of null.

## Examples

```
avg([`10`,`15`,`20`]) == `15`
```
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/base64_decode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# base64_decode

## Signature

`base64_decode(string)`

## Description



## Examples

TODO
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/base64_encode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# base64_encode

## Signature

`base64_encode(string)`

## Description



## Examples

TODO
15 changes: 15 additions & 0 deletions website/docs/reference/jp/examples/ceil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ceil

## Signature

`ceil(number)`

## Description

Returns the next highest integer value by rounding up if necessary.

## Examples

```
ceil(`1.9`) == `2`
```
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# compare

## Signature

`compare(string, string)`

## Description



## Examples

TODO
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/concat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# concat

## Signature

`concat(string, string)`

## Description



## Examples

TODO
32 changes: 32 additions & 0 deletions website/docs/reference/jp/examples/contains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# contains

## Signature

`contains(array|string, any)`

## Description

Returns `true` if the given subject contains the provided search value. If the subject is an array, this function returns `true` if one of the elements in the array is equal to the provided search value. If the provided subject is a string, this function returns `true` if the string contains the provided search argument.

## Examples

### With strings

```
contains('foobar', 'bar') == true
```

```
contains('foobar', 'not') == false
```

### With arrays


```
contains(['foo', 'bar'], 'bar') == true
```

```
contains(['foo', 'bar'], 'not') == true
```
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# divide

## Signature

`divide(any, any)`

## Description



## Examples

TODO
19 changes: 19 additions & 0 deletions website/docs/reference/jp/examples/ends_with.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ends_with

## Signature

`ends_with(string, string)`

## Description

Reports whether the given string ends with the provided suffix argument.

## Examples

```
ends_with('foobar', 'bar') == true
```

```
ends_with('foobar', 'foo') == false
```
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# env

## Signature

`env(string)`

## Description



## Examples

TODO
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/equal_fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# equal_fold

## Signature

`equal_fold(string, string)`

## Description



## Examples

TODO
31 changes: 31 additions & 0 deletions website/docs/reference/jp/examples/find_first.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# find_first

## Signature

`find_first(string, string, number, number)`

## Description



## Examples

```
find_first('subject string', 'string', `0`) == `8`
```

```
find_first('subject string', 'string', `8`) == `8`
```

```
find_first('subject string', 'string', `9`) == null
```

```
find_first('subject string', 'string', `0`, `14`) == `8`
```

```
find_first('subject string', 'string', `0`, `13`) == null
```
31 changes: 31 additions & 0 deletions website/docs/reference/jp/examples/find_last.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# find_last

## Signature

`find_last(string, string, number, number)`

## Description



## Examples

```
find_last('subject string', 'string', `0`) == `8`
```

```
find_last('subject string', 'string', `8`) == `8`
```

```
find_last('subject string', 'string', `9`) == null
```

```
find_last('subject string', 'string', `0`, `14`) == `8`
```

```
find_last('subject string', 'string', `0`, `13`) == null
```
15 changes: 15 additions & 0 deletions website/docs/reference/jp/examples/floor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# floor

## Signature

`floor(number)`

## Description

Returns the next lowest integer value by rounding down if necessary.

## Examples

```
floor(`1.9`) == `1`
```
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/from_items.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# from_items

## Signature

`from_items(array[array])`

## Description



## Examples

TODO
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/group_by.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# group_by

## Signature

`group_by(array, expref)`

## Description



## Examples

TODO
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/items.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# items

## Signature

`items(object|array, string, string)`

## Description



## Examples

TODO
13 changes: 13 additions & 0 deletions website/docs/reference/jp/examples/join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# join

## Signature

`join(string, array[string])`

## Description

Returns all of the elements from the provided array joined together using the glue argument as a separator between each.

## Examples

TODO
Loading

0 comments on commit 1701420

Please sign in to comment.