summaryrefslogtreecommitdiff
path: root/doc/en/weechat_plugin_api.en.asciidoc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-06-30 20:25:35 +0200
committerSébastien Helleu <flashcode@flashtux.org>2015-06-30 20:25:35 +0200
commit9bf40517d3fdc48befec9ea4030338e8e98b1852 (patch)
tree0142fb829326ce8305217899ca9dd5a725100792 /doc/en/weechat_plugin_api.en.asciidoc
parente92a63427f2f3d45646cf0ffc107cf3f0a279f84 (diff)
downloadweechat-9bf40517d3fdc48befec9ea4030338e8e98b1852.zip
api: add support of evaluated sub-strings and current date/time in function string_eval_expression() and command /eval
Diffstat (limited to 'doc/en/weechat_plugin_api.en.asciidoc')
-rw-r--r--doc/en/weechat_plugin_api.en.asciidoc21
1 files changed, 19 insertions, 2 deletions
diff --git a/doc/en/weechat_plugin_api.en.asciidoc b/doc/en/weechat_plugin_api.en.asciidoc
index cca10ff35..369d62782 100644
--- a/doc/en/weechat_plugin_api.en.asciidoc
+++ b/doc/en/weechat_plugin_api.en.asciidoc
@@ -1902,7 +1902,7 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
==== string_eval_expression
-_WeeChat ≥ 0.4.0, updated in 0.4.2 and 1.1._
+_WeeChat ≥ 0.4.0, updated in 0.4.2, 1.0, 1.1, 1.2 and 1.3._
Evaluate an expression and return result as a string.
Special variables with format `${variable}` are expanded (see table below).
@@ -1954,13 +1954,20 @@ Return value:
List of variables expanded in expression (by order of priority, from first
expanded to last):
-[width="100%",cols="2,8,3,3",options="header"]
+[width="100%",cols="2,8,4,4",options="header"]
|===
| Format | Description | Examples | Results
| `${name}` | Variable `name` from hashtable 'extra_vars' |
`${name}` | `value`
+| `${eval:xxx}` +
+ (_WeeChat ≥ 1.3_) |
+ String to evaluate |
+ `${eval:${date:${weechat.look.buffer_time_format}}}` |
+ `19:02:45` (with colors if there are color codes in the option
+ weechat.look.buffer_time_format)
+
| `${esc:xxx}` +
`${\xxx}` | String with escaped chars |
`${esc:prefix\tmessage}` +
@@ -1996,6 +2003,16 @@ expanded to last):
`1.0` +
`lightblue`
+| `${date}` +
+ `${date:xxx}` +
+ (_WeeChat ≥ 1.3_) |
+ Current date/time, with custom format (see `man strftime`),
+ default format is `%F %T` |
+ `${date}` +
+ `${date:%H:%M:%S}` |
+ `2015-06-30 19:02:45` +
+ `19:02:45`
+
| `${env:NAME}` +
(_WeeChat ≥ 1.2_) |
Value of the environment variable `NAME` |