templates/README.md
changeset 143 abfa3aa97b51
parent 141 abaf660dc3fc
child 217 e01f94e81794
equal deleted inserted replaced
142:b0d55f7fddeb 143:abfa3aa97b51
    29     madonctl --theme=ansi stream
    29     madonctl --theme=ansi stream
    30 
    30 
    31 Currently, if a template is missing, madonctl will fall back to the _plain_
    31 Currently, if a template is missing, madonctl will fall back to the _plain_
    32 output format.  (In the future it might just fail with an error message.)
    32 output format.  (In the future it might just fail with an error message.)
    33 
    33 
       
    34 You can set up madonctl so that a theme is used by default.  See the
       
    35 [configuration](../configuration.md) page for details.
       
    36 
    34 ## Templates
    37 ## Templates
    35 
    38 
    36 Here's an example using a template with ANSI color escape codes (for UNIX/Linux):
    39 Here's an example using a template with ANSI color escape codes (for UNIX/Linux):
    37 
    40 
    38     madonctl timeline --limit 2 --template-file ansi-status.tmpl
    41     madonctl timeline --limit 2 --template-file ansi-status.tmpl
    39 
    42 
    40 ### Template development
    43 ### Template development
    41 
    44 
    42 Here's a list of available commands (please check the Go template documentation for the built-in functions):
    45 Here's a list of available commands (please check the Go template documentation
       
    46 for the built-in functions):
    43 
    47 
    44 Function | Description
    48 Function | Description
    45 -------- | -----------
    49 -------- | -----------
    46 fromunix UNIXTIMESTAMP  | converts from UNIX timestampto date
    50 `fromunix UNIXTIMESTAMP`  | converts from UNIX timestampto date
    47 tolocal TEXTRFC3339DATE | converts a RFC3339 date string to a local time
    51 `tolocal TEXTRFC3339DATE` | converts a RFC3339 date string to a local time
    48 fromhtml HTMLTEXT       | converts HTML to plain text
    52 `fromhtml HTMLTEXT`       | converts HTML to plain text
    49 wrap TEXT       | rewrap text, with indent and max width
    53 `wrap TEXT`       | rewrap text, with indent and max width
    50 trim TEXT       | trims text whitespace
    54 `trim TEXT`       | trims text whitespace
    51 color COLORSPEC | sends an ANSI color code sequence
    55 `color COLORSPEC` | sends an ANSI color code sequence
    52 
    56 
    53 *COLORSPEC* is a string with the following format:
    57 *COLORSPEC* is a string with the following format: `[FGCOLOR][,BGCOLOR[,STYLE]]`
    54 `[FGCOLOR][,BGCOLOR[,STYLE]]` or `reset`.
    58 or `reset`.
    55 
    59 
    56 Examples:
    60 Examples:
    57 
    61 
    58 ```
    62 ```
    59   {{color "red"}}red text{{color "reset"}}
    63   {{color "red"}}red text{{color "reset"}}