aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-03-13 22:52:32 +0100
committerRobin Jarry <robin@jarry.cc>2023-03-13 22:53:41 +0100
commit6ea08564041640a4d3552a9934e4317b1086fa9b (patch)
treee594cf35c1409071bae938a92c957d72cb4eb682
parent60078b8452867c9ab40c9623ef63169bdb090c83 (diff)
downloadaerc-6ea08564041640a4d3552a9934e4317b1086fa9b.tar.gz
doc: improve aerc-templates examples
Adjust some examples with real world use cases. Signed-off-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--doc/aerc-templates.7.scd7
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/aerc-templates.7.scd b/doc/aerc-templates.7.scd
index 05084216..c7830b8b 100644
--- a/doc/aerc-templates.7.scd
+++ b/doc/aerc-templates.7.scd
@@ -375,6 +375,7 @@ aerc provides the following additional functions:
```
{{.Style .Account "red"}}
+ {{.Style .ThreadPrefix "thread"}}{{.Subject}}
```
*.StyleSwitch*
@@ -383,7 +384,8 @@ aerc provides the following additional functions:
not match any of the expressions, leave it unstyled.
```
- {{.StyleSwitch (.From | names | join ", ") (case `Tim` "cyan") (case `Robin` "pink-blink")}}
+ {{.StyleSwitch .Subject (`^(\[[\w-]+\]\s*)?\[(RFC )?PATCH` "cyan")}}
+ {{.StyleSwitch (.From | names | join ", ") (case `Tim` "cyan") (case `Robin` "pink-blink") (default "blue")}}
```
*version*
@@ -398,7 +400,7 @@ aerc provides the following additional functions:
use in conditional control flow:
```
- {{if match .Subject `^(\[[\w-]+\]\s*)?\[(RFC )?PATCH`}}{{.Style .Subject "cyan"}}{{else}}{{.Subject}}{{end}}
+ {{if match .Folder `.*/Archive-[0-9]+`}}{{humanReadable .Unread}}{{end}}
```
*switch*
@@ -414,6 +416,7 @@ aerc provides the following additional functions:
All of the template functions can be chained together if needed.
Example: Automatic HTML parsing for text/html mime type messages
+
```
{{if eq .OriginalMIMEType "text/html"}}
{{exec `/usr/libexec/aerc/filters/html` .OriginalText | wrap 72 | quote}}