Markdown, WordPress and round-tripping

I tend to write these posts using Red Sweater Software’s MarsEdit blogging software, which, among other things, supports previewing the results of Markdown-formatted posts.

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.

Workaround 1

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.

Workaround 1.5

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….

Workaround 2

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.

Ideal World

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.

Advertisements

About lidlesseye

Mouthing off about photography, and occasionally important things too.

Posted on May 21, 2009, in Uncategorized and tagged , , , , , , . Bookmark the permalink. 1 Comment.

  1. Do you know if MarsEdit is now capable of rendering Markdown text as it’s posted? I have never really gotten into Markdown for the simple reason that in the past I couldn’t use it to format posts for my WordPress.com hosted blogin MarsEdit.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: