Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/content/manual/dev/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2219,6 +2219,13 @@ sections:
Note that the slashes, question mark, etc. in the URL are
not escaped, as they were part of the string literal.

You can also define custom string formats using "def" syntax,
just like defining functions.

def @foo: gsub("a+"; ".");

Unlike functions, string formats cannot take arguments.

examples:
- program: '@html'
input: '"This works if x < y"'
Expand All @@ -2236,6 +2243,10 @@ sections:
input: '"VGhpcyBpcyBhIG1lc3NhZ2U="'
output: ['"This is a message"']

- program: 'def @foo: gsub("a+"; "."); @foo, @foo "a \(.) \(. + .) a"'
input: '"aba"'
output: ['".b."', '"a .b. .b.b. a"']

- title: "Dates"
body: |

Expand Down
20 changes: 20 additions & 0 deletions jq.1.prebuilt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading