Add Markdown to TextMate

Mar 14, '05 09:01:00AM

Contributed by: chrisp

Although I'm a longtime fan of BBEdit, I've also found TextMate wonderful for handling project-based documents -- and I love its text folding feature and comprehensive syntax colouring functionality. I must get to grips with its use of Bundles for this -- its CSS syntax rules are still very basic.

I was initially doubtful that its 'run command' functionality was as powerful as BBEdit's. I needed to get John Gruber's Markdown perl script added, as this is something I miss from BBEdit. It turns out to be simple, so here's what I did:

  1. Download and decompress markdown.pl, and copy the file into yopur user's Library/Application Support/TextMate/Scripts/ folder. You will have to create this last folder, but anywhere in your home directory would also do.
  2. Launch TextMate and choose Automation:Run command:Edit (or type Control-Alt-Command-C) to open the Bundle Editor.
  3. Create a new command (in Defaults) and name it Markdown.
  4. Add the following settings:
  5. Exit the Bundle Editor window.
Type in some Markdown code, then choose your new Markdown script from the Automation menu -- and a new document is created with valid XHTML. I also created a command to replace the current text selection, which is also useful when creating long XHTML content.

Comments (1)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050310125513151