06.21.06

The GTD format

Posted in TextMate, GTD at 7:53 pm by Haris

This post has two purposes, first to describe the kinkless to gtdalt converter, and second to describe my gtd format as it currently stands and is used in the GTDAlt bundle.

Update: The converter has now been updated to deal with subprojects (thanks bbum for bringing this to my attention!). Also, there is a command now in the bundle. Just open the OPML file in TextMate and run the command.

Let’s start with the converter:

Converting from Kinkless to GTDAlt

Here’s the code for the converter. It will convert your Kinkless file to the gtd format. To use it:

  1. Open your Kinkless file and save it as a OPML file (the third option that shows up when you select “Save As…” from within OmniOutliner).
  2. From the command line, run:

KinklessToGTDConverter.rb < pathtoOPML > kinkless.gtd

  1. You are done!

It’s not perfect, but I think it is stable enough. Let me know if you have problems.

The GTD format

Here I want to describe my GTD format. Its main goal is that it should be easy to read, write and process.

  1. Each gtd file can contain many projects. A project starts with the word project, followed by the title of the project. It ends with the word end in its own line. So for instance:

project My big project various actions here a lot of actions # Commented (completed) actions more actions end

  1. Projects can be nested:

project Big project actions for project project A subproject actions of subproject end end

  1. Each line with first non-space character an ampersand is an action line. It has the format:

@context My action text goes here [4] due:[2006-04-06]

context is of course the context. Then the action text follows, as long as it does not contain a left brace. The number [4] refers to the note associated with the action. More about this later. The part due:[2006-04-06] is of course the due date. It is of the form yyyy-mm-dd, and it is particular about it.

  1. A completed action looks like a commented line:

#completed:[2006-06-20] @context the action

  1. The end of the document contains notes. A note starts with its number in brackets, followed by the note text. It can contain, among other things, URI links enclosed in angle brackets. E.g.

[1] A note here <file:///Users/haris/afile.txt>

[2] Another note <http://www.macromates.com>

And so on.

This is the syntax as it stands at the moment. The main thing I’d like to add at the moment is some support for recurring events, though I am not sure what the best way would be.

Later

15 Comments »

  1. After thought » Yet another GTD bundle said,

    June 23, 2006 at 9:37 am

    […] Update2: Simplified the language grammar, and refined the syntax highlight a bit. Also, there is now a script to convert the Kinkless file to this format. […]

  2. After thought » Details on the GTDAlt bundle said,

    June 25, 2006 at 10:00 pm

    […] You can also find some pretty lame screencasts here, as well as a converter to convert your Kinkless GTD project to this format here. […]

  3. bbum said,

    June 26, 2006 at 4:01 pm

    Seems broken. Or, at least, it only converted the project hierarchy…

  4. Haris said,

    June 26, 2006 at 11:56 pm

    @bbum

    could you provide a test case that breaks?

    Do you by any chance have subprojects? It is possible that my script does not handle that very gracefully.

  5. bbum said,

    June 27, 2006 at 10:09 am

    Sure can. In your mail….

  6. Alan Schmitt said,

    July 1, 2006 at 8:22 am

    I have a small suggestion: have a way to specify the format of dates (I use DD/MM/YY for instance).

  7. Haris said,

    July 1, 2006 at 10:32 am

    @Alan Schmitt

    I’ve thought about it, but it does make my work a lot harder, both in terms of matching the date and in terms of processing it. In mostly makes it harder for commands that have to work with it. Not an insoluble problem, but substantial enough that it becomes a very long term plan.

    The main advantage of the YYYY-MM-DD format is that it sorts properly in the log files, if you want items sorted chronologically, and it is unambiguous, contrary to the DD/MM/YY vs MM/DD/YY issue.

    I know it’s forcing a particular representation onto the user, which is not a very nice thing to do, and hopefully in the future I’ll be able to change this. But for the moment, I hope it will be a small consolation that this is not my standard way of representing dates either, so I have to also get used to it.

  8. Alan Schmitt said,

    July 1, 2006 at 10:50 am

    I understand (and agree with) the YYYY-MM-DD format. However my kGTD file is using the DD/MM/YY format, and if I write a “nice” date, it gets immediately displayed as a DD/MM/YY format.

    My suggestion was simply to allow the input of the converter to take “bad” dates and convert them to “good” dates. I guess I can try to edit the OPML file by hand before running the converter to make things work.

  9. Haris said,

    July 1, 2006 at 10:59 am

    @Alan,

    well, the converter should convert this date to the YYYY-MM-DD format, except that it expects them to be MM/DD/YY instead of DD/MM/YY, and it can’t easily tell those two apart. I’ll see if I can fix this, but I am not sure where to read the setting from. I am guessing one sets these things up from the System Preferences.

    So a solution for now: Try to see if OOP, or System Preferences, allow you to change the date format to MM/DD/YY, and then run the converter. It should do the right thing. Send me a sample file if it doesn’t.

  10. Alan Schmitt said,

    July 1, 2006 at 11:49 pm

    Well, I found it faster to hack the script. I replaced the line
    thedate = Date.parse(o[:duedate],true)
    with the line
    thedate = Date.strptime(o[:duedate],”%d/%m/%y”)
    and dates were correctly parsed.

  11. Haris said,

    July 2, 2006 at 12:25 am

    Heh, that is indeed faster ;) Nice.

  12. Kaleo said,

    August 27, 2006 at 12:53 am

    Thanks for all of the useful info. Just wanted to note that the quotes in:

    thedate = Date.strptime(o[:duedate],”%d/%m/%y”)

    need to be ” (straight quotes) otherwise a syntax error results.

  13. Kaleo said,

    August 27, 2006 at 3:26 am

    I keep getting an error with this. Does it matter where the converter and opml file are saved?

    From the command line, run:
    KinklessToGTDConverter.rb < pathtoOPML > kinkless.gtd

  14. Haris said,

    August 27, 2006 at 9:36 pm

    Kaleo,

    I don’t think it should matter where the converter and the file are saved. The converter just reads from standard input and writes in standard output. What is the error you are getting? You might want to try using the full path to the converter script. If you are at the directory where it is, try it with a ./ in front, i.e. ./KinklessToGTDConverter.rb < pathtoOPML > kinkless.gtd

    The problem might simply be that the ruby script is not marked as an executable, so that the system does not know it is supposed to run it or something. If this doesn’t fix it, then let me know what the error you are getting is, and what the paths are in your case.

  15. links for 2007-05-14 » Graham English Social Networking said,

    May 13, 2007 at 10:27 pm

    […] After thought » The GTD format This post has two purposes, first to describe the kinkless to gtdalt converter, and second to describe my gtd format as it currently stands and is used in the GTDAlt bundle. (tags: LifeHacks Mac plugins software TextMate GTD productivity organization OSX) […]

Leave a Comment