author | Mikael Berthe <mikael@lilotux.net> |
Sun, 07 May 2017 16:38:52 +0200 | |
changeset 86 | 9e846c5af138 |
parent 82 | 9ac2281c07d7 |
child 94 | 4c0206d283e5 |
permissions | -rw-r--r-- |
86 | 1 |
# Templates and Themes |
23 | 2 |
|
3 |
This folder contains sample templates to customize madonctl output. |
|
4 |
||
86 | 5 |
Feel free to contribute if you have nice templates or if you want to work on themes as well! |
6 |
||
7 |
## Configuration |
|
8 |
||
9 |
The template prefix directory can be set in the configuration file with the |
|
10 |
'template_directory' setting, or with the `MADONCTL_TEMPLATE_DIRECTORY` |
|
11 |
environment variable.\ |
|
12 |
If set, template files are looked up relatively from this repository first |
|
13 |
(unless they are absolute paths or start with "./" or "../"). |
|
14 |
||
15 |
The themes are located in the `themes` directory, inside the base template |
|
16 |
directory. |
|
17 |
A theme is a collection of templates grouped in a theme directory (the name of |
|
18 |
the directory is the name of the theme).\ |
|
19 |
E.g. `$template_directory/themes/ansi/` |
|
20 |
||
21 |
## Templates |
|
23 | 22 |
|
23 |
Here's an example using a template with ANSI color escape codes (for UNIX/Linux): |
|
24 |
||
25 |
madonctl timeline --limit 2 --template-file ansi-status.tmpl |
|
26 |
||
86 | 27 |
## Themes |
28 |
||
29 |
To use a theme, simply specify the theme name with the --theme flag (the |
|
30 |
--output=theme flag is implied): |
|
82
9ac2281c07d7
Add 'template_directory' setting
Mikael Berthe <mikael@lilotux.net>
parents:
23
diff
changeset
|
31 |
|
86 | 32 |
madonctl timeline --limit=2 --theme=ansi |
33 |
madonctl accounts statuses --limit 5 --theme ansi |
|
34 |
||
35 |
madonctl --theme=ansi accounts notifications --list |
|
36 |
madonctl --theme=ansi stream |
|
37 |
||
38 |
Currently, if a template is missing, madonctl will fall back to the _plain_ |
|
39 |
output format. (In the future it might just fail with an error message.) |