diff -r 92842a4f5f8b -r abaf660dc3fc templates/README.md --- a/templates/README.md Sun May 14 11:44:14 2017 +0200 +++ b/templates/README.md Sun May 14 12:04:43 2017 +0200 @@ -40,13 +40,18 @@ ### Template development Here's a list of available commands (please check the Go template documentation for the built-in functions): -- fromunix UNIXTIMESTAMP *converts from UNIX timestampto date* -- tolocal TEXTRFC3339DATE *converts a RFC3339 date string to a local time* -- fromhtml HTMLTEXT *converts HTML to plain text* -- wrap TEXT *rewrap text, with indent and max width* -- trim TEXT *trims text whitespace* -- color COLORSPEC *sends an ANSI color code sequence*\ - COLORSPEC is a string with the following format: `[FGCOLOR][,BGCOLOR[,STYLE]]` or `reset`. + +Function | Description +-------- | ----------- +fromunix UNIXTIMESTAMP | converts from UNIX timestampto date +tolocal TEXTRFC3339DATE | converts a RFC3339 date string to a local time +fromhtml HTMLTEXT | converts HTML to plain text +wrap TEXT | rewrap text, with indent and max width +trim TEXT | trims text whitespace +color COLORSPEC | sends an ANSI color code sequence + +*COLORSPEC* is a string with the following format: +`[FGCOLOR][,BGCOLOR[,STYLE]]` or `reset`. Examples: @@ -57,7 +62,3 @@ Message: {{color "blue"}}{{.content | fromhtml | wrap " " 80 | trim}}{{color "reset"}} ``` - -Note that the _wrap_ implementation might change in the future; currently it is -paragraph-based, not line-based, and the result can be surprising after -_fromhtml_ (carriage returns are ignored).