README.md in calrom-0.2.0 vs README.md in calrom-0.3.0

- old
+ new

@@ -44,20 +44,82 @@ ... for an arbitrary date range: `$ calrom 2028-01-15 2028-03-07` +### Selecting calendar + +There are a few calendars bundled in calrom (actually in the calendarium-romanum gem) +and ready to use. List them: + +`$ calrom --calendars` + +Each entry of the listing contains an ID of the calendar, it's name and language code. +Use calendar ID to request General Roman Calendar in Latin: + +`$ calrom --calendar=universal-la` + +You can prepare [your own calendar data][carodata] and load them: + +`$ calrom --calendar=path/to/my_calendar.txt` + +If you specify more than one calendar, they are loaded "layered" one over another +(from left to right), which comes in handy when extending a general calendar +with just a few additional and/or differing celebrations, e.g. solemnities (titular, dedication) +of the local church: + +`$ calrom --calendar=universal-la --calendar=path/to/our_local_celebrations.txt` + ### Data presentation settings Print detailed listing: `$ calrom -l` Disable colours: `$ calrom --no-color` +Machine-readable output formats: + +`$ calrom --format=json` - prints JSON array containing one object per day. +The object contents mimick output of the [Church Calendar API v0][calapidoc]. + +`$ calrom --format=csv` - prints a CSV, one celebration per line +(i.e. there is one or more lines for each liturgical day). + +### Configuration files + +`calrom` looks for configuration files `/etc/calromrc` and `~/.calromrc`. +They are processed in this order and both are used if available. +Their syntax is that of shell options and arguments (with the sole exception that newline +is not considered end of shell input, but generic whitespace), supported are all options and arguments +accepted by the command. +It usually makes sense to use configuration files only for the most fundamental settings +you will never change, like selecting calendar (if you know you will always check this single one) +or disabling colours (if you hate colourful output). + +If a custom configuration file location is specified on the command line, +`$ calrom --config=path/to/my/custom/config`, the standard system-wide and user-specific configuration +files are *not* loaded. + +Example configuration file, loading the proper calendar of the archdiocese of Prague +and disabling colours: + +```bash +# shell-like comments can be used in configuration files + +--calendar=czech-cs # celebrations common for the whole Czech Republic +--calendar=czech-cechy-cs # Bohemia +--calendar=czech-praha-cs # archdiocese of Prague +--calendar=/home/igneus/calendar_data/local_church.txt # path to a custom calendar file with proper celebrations of the parish where I live (titular feast of the church, dedication) + +--no-color # disable colours +``` + +(Configuration file format is inspired by [.rspec][dotrspec].) + ## Running tests Clone the repository, `$ bundle install` to install dependencies, then: `$ rake cucumber` - run specs describing the command line interface @@ -67,18 +129,18 @@ `$ rake` - run all groups of specs one after another ## Project roadmap * [x] detailed listing of a day/month/year/range of dates -* [ ] month/year overview - options and output mostly mimicking the +* [ ] month/year overview - options and output mostly mimicking the BSD Unix [`cal`][cal] utility, but with liturgical colours and celebration ranks * [ ] condensed format (but with detailed information) suitable for awesome/i3 toolbars etc. -* [ ] machine-readable detailed listing +* [x] machine-readable detailed listing * [ ] year summary: lectionary cycles, movable feasts -* [ ] configuration file to set default options -* [ ] specify calendar data path (with support for layering several calendars) +* [x] configuration file to set default options +* [x] specify calendar data path (with support for layering several calendars) * [ ] option to auto-select one of optional celebrations - with multiple supported strategies (prefer ferial, take first non-ferial, configured whitelist, blacklist) * [ ] integrate online data sources * [ ] interactive browsing ## Backward compatibility @@ -112,8 +174,11 @@ ## License GNU/GPL 3.0 or later [caro]: https://github.com/igneus/calendarium-romanum +[carodata]: https://github.com/igneus/calendarium-romanum/tree/master/data +[calapidoc]: http://calapi.inadiutorium.cz/api-doc [semver]: https://semver.org/ [cal]: https://www.freebsd.org/cgi/man.cgi?query=cal [taoup]: http://www.catb.org/esr/writings/taoup/html/ch10s05.html +[dotrspec]: https://relishapp.com/rspec/rspec-core/v/2-0/docs/configuration/read-command-line-configuration-options-from-files