Escape some code parts in manual. (#3184)

This commit is contained in:
Michael Färber authored and GitHub committed 2025-01-25 21:55:06 +09:00
1 parent d8463c2549
commit 18bd8374c1
3 files changed
+30 -30

No files matched your search

+10 -10
View File
@@ -1011,15 +1011,15 @@ sections:
The key difference between `map(f)` and `map_values(f)` is
that the former simply forms an array from all the values of
`($x|f)` for each value, $x, in the input array or object,
`($x|f)` for each value, `$x`, in the input array or object,
but `map_values(f)` only uses `first($x|f)`.
Specifically, for object inputs, `map_values(f)` constructs
the output object by examining in turn the value of
`first(.[$k]|f)` for each key, $k, of the input. If this
`first(.[$k]|f)` for each key, `$k`, of the input. If this
expression produces no values, then the corresponding key
will be dropped; otherwise, the output object will have that
value at the key, $k.
value at the key, `$k`.
Here are some examples to clarify the behavior of `map` and
`map_values` when applied to arrays. These examples assume the
@@ -2292,13 +2292,13 @@ sections:
jq provides a few SQL-style operators.
* INDEX(stream; index_expression):
* `INDEX(stream; index_expression)`:
This builtin produces an object whose keys are computed by
the given index expression applied to each value from the
given stream.
* JOIN($idx; stream; idx_expr; join_expr):
* `JOIN($idx; stream; idx_expr; join_expr)`:
This builtin joins the values from the given stream to the
given index. The index's keys are computed by applying the
@@ -2307,22 +2307,22 @@ sections:
value from the index is fed to the given join expression to
produce each result.
* JOIN($idx; stream; idx_expr):
* `JOIN($idx; stream; idx_expr)`:
Same as `JOIN($idx; stream; idx_expr; .)`.
* JOIN($idx; idx_expr):
* `JOIN($idx; idx_expr)`:
This builtin joins the input `.` to the given index, applying
the given index expression to `.` to compute the index key.
The join operation is as described above.
* IN(s):
* `IN(s)`:
This builtin outputs `true` if `.` appears in the given
stream, otherwise it outputs `false`.
* IN(source; s):
* `IN(source; s)`:
This builtin outputs `true` if any value in the source stream
appears in the second stream, otherwise it outputs `false`.
@@ -2844,7 +2844,7 @@ sections:
{"title": "First post", "author": "Anonymous Coward"}
{"title": "A well-written article", "author": "Person McPherson"}
We use a variable, $names, to store the realnames object, so that we
We use a variable, `$names`, to store the realnames object, so that we
can refer to it later when looking up author usernames:
.realnames as $names | .posts[] | {title, author: $names[.author]}
+10 -10
View File
@@ -999,15 +999,15 @@ sections:
The key difference between `map(f)` and `map_values(f)` is
that the former simply forms an array from all the values of
`($x|f)` for each value, $x, in the input array or object,
`($x|f)` for each value, `$x`, in the input array or object,
but `map_values(f)` only uses `first($x|f)`.
Specifically, for object inputs, `map_values(f)` constructs
the output object by examining in turn the value of
`first(.[$k]|f)` for each key, $k, of the input. If this
`first(.[$k]|f)` for each key, `$k`, of the input. If this
expression produces no values, then the corresponding key
will be dropped; otherwise, the output object will have that
value at the key, $k.
value at the key, `$k`.
Here are some examples to clarify the behavior of `map` and
`map_values` when applied to arrays. These examples assume the
@@ -2239,13 +2239,13 @@ sections:
jq provides a few SQL-style operators.
* INDEX(stream; index_expression):
* `INDEX(stream; index_expression)`:
This builtin produces an object whose keys are computed by
the given index expression applied to each value from the
given stream.
* JOIN($idx; stream; idx_expr; join_expr):
* `JOIN($idx; stream; idx_expr; join_expr)`:
This builtin joins the values from the given stream to the
given index. The index's keys are computed by applying the
@@ -2254,22 +2254,22 @@ sections:
value from the index is fed to the given join expression to
produce each result.
* JOIN($idx; stream; idx_expr):
* `JOIN($idx; stream; idx_expr)`:
Same as `JOIN($idx; stream; idx_expr; .)`.
* JOIN($idx; idx_expr):
* `JOIN($idx; idx_expr)`:
This builtin joins the input `.` to the given index, applying
the given index expression to `.` to compute the index key.
The join operation is as described above.
* IN(s):
* `IN(s)`:
This builtin outputs `true` if `.` appears in the given
stream, otherwise it outputs `false`.
* IN(source; s):
* `IN(source; s)`:
This builtin outputs `true` if any value in the source stream
appears in the second stream, otherwise it outputs `false`.
@@ -2789,7 +2789,7 @@ sections:
{"title": "First post", "author": "Anonymous Coward"}
{"title": "A well-written article", "author": "Person McPherson"}
We use a variable, $names, to store the realnames object, so that we
We use a variable, `$names`, to store the realnames object, so that we
can refer to it later when looking up author usernames:
.realnames as $names | .posts[] | {title, author: $names[.author]}