Author image Paul Hoffman
and 1 contributors

NAME

rem2yaml - convert the output of remind(1) to YAML

SYNOPSIS

rem2yaml [option...] [file...]

rem2yaml -h|--help

rem2yaml -V|--version

DESCRIPTION

rem2yaml processes the output produced by remind(1) as intended for back-end programs (such as rem2ps(1)), printing reminders as a stream of YAML documents.

The input to rem2yaml must have been generated by remind(1) using its options -p and -l.

rem2yaml's output comes in two flavors, consolidated and unconsolidated. In unconsolidated form, each document in the YAML stream is a single reminder; consolidation brings all of a day's reminders together into a single document. These two cases are illustrated below.

If no file is specified, or if the file name - is specified, standard input will be processed.

OPTIONS

-c, --consolidate

Consolidate events for each day. Each YAML document in the output will represent a single day, with the reminders for that day gathered into a reminders element.

For example, consider the following remind(1) input file:

    # /home/nkuitse/dt/foo.rem
    REM Tue MSG %"Organizing day%"
    REM Mar 1 MSG %"Ulysses's birthday%"%
    REM Mar 4 2008 AT 08:30 %"Pick up Aunt Yolanda from the airport%"% 

Running this through remind(1) at some time during March 2008 yields all reminders for that month in a compact form:

    $ remind -p -l /home/nkuitse/dt/foo.rem
    # rem2ps begin
    March 2008 31 6 0
    Sunday Monday Tuesday Wednesday Thursday Friday Saturday
    February 29
    April 30
    # fileinfo 2 /home/nkuitse/dt/foo.rem
    2008/03/01 * * * * Ulysses's birthday
    # fileinfo 1 /home/nkuitse/dt/foo.rem
    2008/03/04 * * * * Organizing day
    # fileinfo 1 /home/nkuitse/dt/foo.rem
    2008/03/11 * * * * Organizing day
    # fileinfo 3 /home/nkuitse/dt/foo.rem
    2008/03/18 * * * 510  8:30am Pick up Aunt Yolanda from the airport
    # fileinfo 1 /home/nkuitse/dt/foo.rem
    2008/03/18 * * * * Organizing day
    # fileinfo 1 /home/nkuitse/dt/foo.rem
    2008/03/25 * * * * Organizing day
    # rem2ps end

Running this through b<rem2yaml> without consolidation yields a series of six YAML documents, one for each reminder. For example, the reminders for March 18 would look something like this:

    ---
    description: Organizing day
    date: 20080318
    date_time: 20080318
    year: 2008
    month: 3
    day: 18
    day_of_week: 2
    all_day: 1
    event: 2
    file: /home/nkuitse/dt/foo.rem
    line: 1
    instance: 3
    ---
    description: Pick up Aunt Yolanda from the airport
    date: 20080318
    date_time: 20080318T083000
    year: 2008
    month: 3
    day: 18
    day_of_week: 2
    hour: 8
    minute: 30
    event: 3
    file: /home/nkuitse/dt/foo.rem
    line: 3
    instance: 1

With consolidation, these two reminders would be brought together like so:

    ---
    date: 20080318
    year: 2008
    month: 3
    day: 18
    day_of_week: 2
    reminders:
      - description: Organizing day
        date: 20080318
        date_time: 20080318
        year: 2008
        month: 3
        all_day: 1
        day: 18
        day_of_week: 2
        event: 2
        file: /home/nkuitse/dt/foo.rem
        line: 1
        instance: 3
      - description: Pick up Aunt Yolanda from the airport
        date: 20080318
        date_time: 20080318T083000
        year: 2008
        month: 3
        day: 18
        day_of_week: 2
        hour: 8
        minute: 30
        event: 3
        file: /home/nkuitse/dt/foo.rem
        line: 3
        instance: 1
-C, --noconsolidate

Do not consolidate events into days. This is the default, so this option is generally only used after -d, -b, -e, and -l.

-f, --fill-gaps

If a day (within any applicable range) has no reminders associated with it, generate a placeholder for the day with an empty reminders list.

This option turns on consolidation, and must be used in conjunction with it.

-d date, --date date

Turn on consolidation and limit output to the specified date. The date must be provided in one of these formats:

    YYYYMMDD
    YYYY-MM-DD
    YYYY/MM/DD
-b date, --begin date

Turn on consolidation and limit output to dates on or after the specified date. The date format is the same as for option -d.

-e date, --end date

Turn on consolidation and limit output to dates on or before the specified date. The date format is the same as for option -d.

-l date, --limit date

Turn on consolidation and limit output to dates strictly before the specified date. The date format is the same as for option -d.

Note the difference between -e and -l: the former includes the given date, while the latter excludes it.

-v, --verbose

Be verbose.

-h, --help

Print help information and exit.

-V, --version

Print the version number and exit. If the -v or --verbose option is specified, print out additional information.

-M, --manual

View the manual page for rem2yaml.

-L, --license

View the license under which rem2yaml is distributed.

AUTHOR

Paul Hoffman (nkuitse AT nkuitse DOT com)

COPYRIGHT

Copyright 2007-2008 Paul M. Hoffman.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl:

a)

the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version;

or

b)

the "Artistic License".

For the full text of these licenses, see the script file itself or enter the command rem2yaml -L.

SEE ALSO

remind(1), rem2ps(1), Remind::Parser, YAML.