Skip to content

Advanced Formatting

Eric Amodio edited this page Jun 6, 2017 · 2 revisions

Advanced Formatting

Advanced formatting of template settings follows the pattern: ${<token>|<number><?><->}.

Where number is basically a truncation/padding value, ? specifies how strictly number will be treated, - specifies that is should be padded on the left rather than on the right.

Example: ${message|40?} ${ago|14-}

Here the message will be truncated or padded on the right to 40 characters and ago will be truncated or padded on the left to ~14 characters because of the ? any whitespace between the right padding of message and ago will be collapsed so that ago could expand beyond 14 characters. Given that, altogether the combined width will always be 54 characters, but how much ago can fill is dependent on its length and the length of message

Clone this wiki locally