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:
- 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.
- Launch TextMate and choose Automation:Run command:Edit (or type Control-Alt-Command-C) to open the Bundle Editor.
- Create a new command (in Defaults) and name it Markdown.
- Add the following settings:
- Save: Nothing
- Command(s): Enter the full path to the location where you saved markdown.pl
- Input: Entire document
- Output: Open as new document
- Activation: whatever you want
- Scope: leave blank
- 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