From 40ae07c1e8b8357dbdb3a18fc8d2bda1601a9210 Mon Sep 17 00:00:00 2001 From: sentriz Date: Mon, 15 Feb 2021 23:38:43 +0000 Subject: [PATCH] Update docs for trunc format helper --- README.md | 1 + doc/playerctl.1.in | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 6d89f61..161441f 100644 --- a/README.md +++ b/README.md @@ -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 | | ------------ | ------------------------------------------------- | diff --git a/doc/playerctl.1.in b/doc/playerctl.1.in index 87e7810..31d60dc 100644 --- a/doc/playerctl.1.in +++ b/doc/playerctl.1.in @@ -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.