From cc9d5ce4a3345291d9b00be76660f5969385c455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20F=C3=A4rber?= <01mf02@gmail.com> Date: Fri, 27 Sep 2024 16:27:25 +0200 Subject: [PATCH] Escape some code parts in manual. This is needed to make the Markdown -> HTML conversion work with Pandoc, see https://github.com/jqlang/jq/issues/3183. --- docs/content/manual/v1.7/manual.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/content/manual/v1.7/manual.yml b/docs/content/manual/v1.7/manual.yml index 06e63aa7a0..078b896010 100644 --- a/docs/content/manual/v1.7/manual.yml +++ b/docs/content/manual/v1.7/manual.yml @@ -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]}