Update docs for trunc format helper

This commit is contained in:
sentriz
2021-02-15 23:38:43 +00:00
parent 1bf2887a58
commit 40ae07c1e8
2 changed files with 7 additions and 0 deletions

View File

@@ -116,6 +116,7 @@ playerctl metadata --format "Volume: {{ volume * 100 }}"
| `markup_escape` | string | Escape XML markup characters in the string. |
| `default` | any, any | Print the first value if it is present, or else print the second. |
| `emoji` | status or volume | Try to convert the variable to an emoji representation. |
| `trunc` | string, int | Truncate string to a maximum length. |
| Variable | Description |
| ------------ | ------------------------------------------------- |

View File

@@ -251,6 +251,12 @@ to an emoji representation. Currently implemented for
.Fa status
and
.Fa volume .
.It Fn trunc str len
Truncate
.Fa str
to a maximum of
.Fa len
characters, adding an ellipsis (…) if necessary.
.El
.Pp
The template language is also able to perform basic math operations.