Skip to content

Commit 931a362

Browse files
authored
docs: Use a better input example in the streaming section (#3322)
The introduction says all the usage examples (e.g. of truncate_stream, etc) in the section use [0,[1]] as input, but they actually use [1,[2]]. ["a",["b"]] seems better than [1,[2]] as the string values won't be confusable with the indexes in <path>.
1 parent a8f27cc commit 931a362

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

docs/content/manual/dev/manual.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3384,8 +3384,8 @@ sections:
33843384
33853385
Several builtins are provided to make handling streams easier.
33863386
3387-
The examples below use the streamed form of `[0,[1]]`, which is
3388-
`[[0],0],[[1,0],1],[[1,0]],[[1]]`.
3387+
The examples below use the streamed form of `["a",["b"]]`, which is
3388+
`[[0],"a"],[[1,0],"b"],[[1,0]],[[1]]`.
33893389
33903390
Streaming forms include `[<path>, <leaf-value>]` (to indicate any
33913391
scalar value, empty array, or empty object), and `[<path>]` (to
@@ -3402,9 +3402,9 @@ sections:
34023402
given streaming expression.
34033403
34043404
examples:
3405-
- program: 'truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]])'
3405+
- program: 'truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]])'
34063406
input: '1'
3407-
output: ['[[0],2]', '[[0]]']
3407+
output: ['[[0],"b"]', '[[0]]']
34083408

34093409
- title: "`fromstream(stream_expression)`"
34103410
body: |
@@ -3413,9 +3413,9 @@ sections:
34133413
outputs.
34143414
34153415
examples:
3416-
- program: 'fromstream(1|truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]]))'
3416+
- program: 'fromstream(1|truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]]))'
34173417
input: 'null'
3418-
output: ['[2]']
3418+
output: ['["b"]']
34193419

34203420
- title: "`tostream`"
34213421
body: |

docs/content/manual/v1.7/manual.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,8 +3317,8 @@ sections:
33173317
33183318
Several builtins are provided to make handling streams easier.
33193319
3320-
The examples below use the streamed form of `[0,[1]]`, which is
3321-
`[[0],0],[[1,0],1],[[1,0]],[[1]]`.
3320+
The examples below use the streamed form of `["a",["b"]]`, which is
3321+
`[[0],"a"],[[1,0],"b"],[[1,0]],[[1]]`.
33223322
33233323
Streaming forms include `[<path>, <leaf-value>]` (to indicate any
33243324
scalar value, empty array, or empty object), and `[<path>]` (to
@@ -3335,9 +3335,9 @@ sections:
33353335
given streaming expression.
33363336
33373337
examples:
3338-
- program: "truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]])"
3338+
- program: 'truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]])'
33393339
input: "1"
3340-
output: ["[[0],2]", "[[0]]"]
3340+
output: ['[[0],"b"]', '[[0]]']
33413341

33423342
- title: "`fromstream(stream_expression)`"
33433343
body: |
@@ -3346,9 +3346,9 @@ sections:
33463346
outputs.
33473347
33483348
examples:
3349-
- program: "fromstream(1|truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]]))"
3349+
- program: 'fromstream(1|truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]]))'
33503350
input: "null"
3351-
output: ["[2]"]
3351+
output: ['["b"]']
33523352

33533353
- title: "`tostream`"
33543354
body: |

jq.1.prebuilt

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/man.test

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)