From 9585bb7e26f190358ccc825b26cd758eacaf5357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Sun, 27 Oct 2024 18:15:54 +0100 Subject: [PATCH] docs: document changes --- CHANGELOG.md | 1 + docs/src/expression_language.md | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ee0298b..41903683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to eww will be listed here, starting at changes since versio ### Features - Add OnDemand support for focusable on wayland (By: GallowsDove) +- Add jq `raw-output` support (By: RomanHargrave) - Update rust toolchain to 1.81.0 (By: w-lfchen) - Add `:fill-svg` and `:preserve-aspect-ratio` properties to images (By: hypernova7, w-lfchen) - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index 150cf0ed..726ff793 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -47,14 +47,17 @@ Supported currently are the following features: - `degtorad(number)`: Converts a number from degrees to radians - `radtodeg(number)`: Converts a number from radians to degrees - `replace(string, regex, replacement)`: Replace matches of a given regex in a string - - `search(string, regex)`: Search for a given regex in a string (returns array) - - `matches(string, regex)`: check if a given string matches a given regex (returns bool) - - `captures(string, regex)`: Get the captures of a given regex in a string (returns array) - - `strlength(value)`: Gets the length of the string + - `search(string, regex)`: Search for a given regex in a string (returns array) + - `matches(string, regex)`: check if a given string matches a given regex (returns bool) + - `captures(string, regex)`: Get the captures of a given regex in a string (returns array) + - `strlength(value)`: Gets the length of the string - `substring(string, start, length)`: Return a substring of given length starting at the given index - - `arraylength(value)`: Gets the length of the array - - `objectlength(value)`: Gets the amount of entries in the object - - `jq(value, jq_filter_string)`: run a [jq](https://stedolan.github.io/jq/manual/) style command on a json value. (Uses [jaq](https://crates.io/crates/jaq) internally). + - `arraylength(value)`: Gets the length of the array + - `objectlength(value)`: Gets the amount of entries in the object + - `jq(value, jq_filter_string)`: run a [jq](https://jqlang.github.io/jq/manual/) style command on a json value. (Uses [jaq](https://crates.io/crates/jaq) internally). + - `jq(value, jq_filter_string, args)`: Emulate command line flags for jq, see [the docs](https://jqlang.github.io/jq/manual/#invoking-jq) on invoking jq for details. Invalid flags are silently ignored. + Currently supported flags: + - `"r"`: If the result is a string, it won't be formatted as a JSON string. The equivalent jq flag is `--raw-output`. - `get_env(string)`: Gets the specified enviroment variable - `formattime(unix_timestamp, format_str, timezone)`: Gets the time in a given format from UNIX timestamp. Check [chrono's documentation](https://docs.rs/chrono/latest/chrono/format/strftime/index.html) for more