summaryrefslogtreecommitdiffstats
path: root/imagrc.toml
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-10-14 11:01:38 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-10-14 11:17:42 +0200
commit2d0944d814003c4abde2af66bb277d167f278433 (patch)
tree69fdc90f2c7bdbf2cab6445bdf9f81e362c0a4fd /imagrc.toml
parent41374fb6200d8bd919a4e0752fa0857cb7ef1e6c (diff)
Add explanation which fns are supported in templates
Diffstat (limited to 'imagrc.toml')
-rw-r--r--imagrc.toml53
1 files changed, 44 insertions, 9 deletions
diff --git a/imagrc.toml b/imagrc.toml
index ccc1f551..93184460 100644
--- a/imagrc.toml
+++ b/imagrc.toml
@@ -1,6 +1,49 @@
# This is a example configuration file for the imag suite.
# It is written in TOML
+#
+# imag supports templates when specifying formats. The templates support several
+# functionalities, from colorizing to underlining and such things.
+#
+# Here goes a list of supported formatting helpers:
+#
+# These functions can be applied for colorizing the output:
+# {{black <input>}}
+# {{blue <input>}}
+# {{cyan <input>}}
+# {{green <input>}}
+# {{purple <input>}}
+# {{red <input>}}
+# {{white <input>}}
+# {{yellow <input>}}
+#
+# The following functions are allowed for formatting text:
+# {{lpad <count> <input>}} - to "left pad" by <count> spaces
+# {{rpad <count> <input>}} - to "right pad" by <count> spaces
+# {{abbrev <count> <input>}} - to "abbreviate" the output to <count> chars
+# {{underline <input>}} - for underlining
+# {{bold <input>}} - for making input bold
+# {{blink <input>}} - for making input blinking
+# {{strikethrough <input>}} - for making input struck through
+#
+# Strings can only be printed. Arrays can be indexed with the `lookup` function.
+#
+#
+# The underlying templating engine also supports these:
+#
+# {{#raw}} ... {{/raw}} escape handlebars expression within the block
+# {{#if ...}} ... {{else}} ... {{/if}} if-else block
+# {{#unless ...}} ... {{else}} .. {{/unless}} if-not-else block
+# {{#each ...}} ... {{/each}} iterates over an array or object.
+# Handlebar-rust doesn't support mustach iteration syntax so use this instead.
+# {{#with ...}} ... {{/with}} change current context. Similar to {{#each}}, used for replace corresponding mustach syntax.
+# {{lookup ... ...}} get value from array by @index or @key
+# {{> ...}} include template with name
+# {{log ...}} log value with rust logger, default level: INFO. Currently you cannot change the level.
+#
+# Warning: These are _not_ tested and should be used with care.
+#
+
# The alias section
#
# In this section one can define aliases for imag subcommands.
@@ -19,6 +62,7 @@ store = [ "s", "st" ]
level = "debug"
destinations = [ "-" ]
+#
# Valid variables for logging:
# * "level"
# * "module_path"
@@ -27,15 +71,6 @@ destinations = [ "-" ]
# * "target"
# * "message"
#
-# Valid functions to be applied:
-# * "black"
-# * "blue"
-# * "cyan"
-# * "green"
-# * "purple"
-# * "red"
-# * "white"
-# * "yellow"
[imag.logging.format]
trace = "[imag][{{red level}}][{{module_path}}]: {{message}}"