Markdown, WordPress and round-tripping
Posted by lidlesseye
OK, so I’ve become rather fond of Markdown, now that I have figured it out, and I was dismayed to find that the free hosted WordPress.com account doesn’t currently support it; this means that my Markdown-formatted stuff looks like ass once posted. Well, no, but it does look like Markdown, and not like fully-formed HTML. Bum.
In the presence of both MarsEdit and BBEdit, I suggest the folowing workaround:
- Install the standalone version of Markdown in the BBEdit Unix Filters folder (usually ~/Library/Application Support/BBEdit/Unix Support/Unix Filters);
- Write the post in MarsEdit as usual, and format in Markdown as desired;
- Once the post is completed, use the ‘edit in BBEdit’ command (File:Edit With BBEdit — the keyboard shortcut is alt-command-J by default) to send the text to that hallowed editor;
- In BBEdit, pass the text through the Markdown filter by selecting the text, and then (to quote from John Gruber’s original documentation) “choose Markdown from the Filters sub-menu in the ‘#!’ menu, or the Filters floating palette”.
- Save and close the temporary file to send the file back to MarsEdit;
- Review the returned text in MarsEdit, and post to weblog.
This is a workaround, and it’s pretty clumsy, but it works now. I don’t know if TextWrangler supports Unix Filters, but if it does, then this should work there as well.
If you don’t have BBEdit, but you do have too much time on your hands, you could probably wangle something by saving the post to a text file, running it through the markdown.pl filter from the command line, and copying the resulting text file back into MarsEdit. But if you’re going to do that, you’re probably in a position to just go straight to….
This is something I have yet to write out properly, but what needs to happen is for an AppleScript to take a selection of text, pass it through the Markdown script, and return it to replace the selection. Post. Like I said, I haven’t written it, but I suppose I’ll figure it out, at which point I’ll make it available.
The great folks at Red Sweater software have already said that they’re looking at rendering Markdown text as it’s posted. That would make all this stuff redundant, and in fact it would be awesome. Consider this a feature request.