August 9, 2007

Tinderbox 4: using Markdown

Tinderbox 4 offers advanced users some remarkable new levels of flexibility.

From time to time, people have suggested we replace Tinderbox's text editor with something simpler, like Markdown or Textile. So, instead of choosing bold from the style menu, you'd write **bold**.

Now, if you'd like to use a different markup language, you can!

Normally, when you want Tinderbox to export the text of a note, you use the markup element ^text to say, "convert the text to HTML and put it here." But, suppose you don't want to use the built-on converter. Instead, you'd like to use (say) Markdown. Easy enough! The new markup element is just:

^value(runCommand("perl ~/",$Text)

This says: "I want you to export the value of running the Markdown command, using $Text as its input." Rather use Textile? Just use a different command. Want to use normal editing on some kinds of notes and Markdown on others? Just choose a prototype, and inherit the template and its export command from the prototype.

This also means that you could use easily Markdown for some kinds of notes — PackingLists and Requistions, say — but not for other kinds of notes.

Markdown for Tinderbox took about 10 minutes from download to done. More to the point, you only have to do things like this once. But it's nice to know you can do it, if you need to.