document the different formatters

This commit is contained in:
Abraham Toriz 2022-08-31 08:44:55 -04:00
parent de1a4a2849
commit dbbeea9f78
No known key found for this signature in database
GPG Key ID: D5B4A746DB5DD42A
2 changed files with 58 additions and 1 deletions

View File

@ -229,6 +229,63 @@ day in the computer's timezone. Add `Z` or an offset to specify the timezone.
* `1h30m ago`
* `two hours thirty minutes ago`
## Default formatters
Tiempo comes with a handful of formatters that display your entries in different
ways. Here's the full list.
### chart
(New in 1.4.0) Displays a nice chart of the weekly progress.
**Settings**
By default this formatter will only display a nice chart of the progress divided
by week and respecting the `week_start` setting. However you may specify a daily
goal and a weekly goal to customize the chart, as well as how many minutes each
character represents:
In toml:
```toml
[formatters.chart]
daily_goal_hours = 4
weekly_goal_hours = 20
character_equals_minutes = 30
```
In yaml:
```yaml
formatters:
chart:
daily_goal_hours: 4
weekly_goal_hours: 20
character_equals_minutes: 30
```
### text
Displays nicely the entries grouped by sheet and day.
### ical
This formatter's output can be redirected to a file and then uploaded to a
calendar app.
### csv
Basically dump the entries as CSV to stdout. Useful for passing entries to a
different tool.
### json
Dump the entries in JSON format.
### ids
Dump only the ids in a single line
## Custom formatters
You can implement your own formatters for all subcommands that display entries

View File

@ -105,7 +105,7 @@ fn main() {
.takes_value(true).value_name("FORMAT")
.help(
"The output format. Valid built-in formats are chart, text, ical, \
csv, json, ids. Documentation on defining custom formats can be \
csv, json and ids. Documentation on defining custom formats can be \
found at https://gitlab.com/categulario/tiempo"
);