Back in August I wrote a post about using Literature and Latte’sScrivener as a complete Blogging System". What I wasn’t expecting was how that post drummed up a lot conversation about MultiMarkdown and writing in Markdown in general. After going back and forth with you all (a genuine pleasure), I realized that I hadn’t really covered the process of exporting your MMD documents from Scrivener into clean, valid html for whatever web-based platform you were using.

I thought I’d take care of that now and write a companion piece on both setting up Scrivener to use Fletcher Penney’s MultiMarkDown and, once installed, how to easily compile your documents and export them as clean html that you can then copy and paste into the WYSWYG of your preferred blogging platform.

First, let’s get MultiMarkdown installed (if you don’t have it installed already)...

Markdown Export

One thing I failed to mention in that original post was that you actually may not have MultiMarkdown installed on your computer. I say this, because I didn’t. The easiest way to tell (without using the command line)? Open Scrivener, click the Compile button and hit the drop down at the bottom. If you see just “MultiMarkdown” as an option and nothing else, you don’t have everything you need to compile your MMD document into html.

Here’s what you need to do (don’t worry, it’s easy I promise):

  1. Go to Fletcher Penney’s MultiMarkdown downloads page and grab the install that matches the OS you are using on the computer in front of you. I usually download to my desktop to find it easier.
  2. Unzip the file that downloads and double-click the installer within.
  3. Follow the onscreen directions to complete the install.
That’s it! Told you it was easy.

What now?

If you had Scrivener open prior to the download, save your project and quit. Now re-open Scrivener and you should now see a whole new host of MultiMarkdown options under the drop down at the bottom of the “Compile” menu! mmdoptionsinscrivener

For most of you, the “MultiMarkdown -> Web Page (.html)” option is all you need. Click that and then click the “Compile” button. Again, I like to save the exported .html doc to my desktop to find it easily, but feel free save the document wherever you like and open it in a text editor. To do this, right-click your new .html file and choose an editor like Textmate, Coda or even good old Notepad. Once open, you’ll see that all of your MultiMarkdown has now changed from this:

mmdcode

To this:

ScrivMMDExport

The code you are interested in (unless your working with a static HTML-based site) is within the opening and closing body tags (<body></body>). Copy that code and post it into your site’s editor. When you do this, make sure you are in HTML mode in your site’s editor (in WordPress it’s under the “Text” tab), otherwise you’ll end up with a post contains all of your text as well as all of the html tags. Trust me, it looks funny and broken when you do it.

Hey, this is great! Thanks! But what’s the point to all of this?

Well, put simply, WYSIWYG editors have come a long way over the years, but they are still far from perfect.

If you’ve ever written a post, pasted it into the editor of your site and spent the next hour cleaning up code the editor thought you wanted, you probably wouldn’t want to write on your web site again for a while. On the flip side though, these same web site editors will just about always take clean and valid html code and render it correctly - displaying everything just as you’d expect. Still, trying to write in html (not to mention valid html) is a pain in the butt too - we shouldn’t have to frankly - and, luckily, with Markdown we don’t have to.

That’s why it’s so damn convenient that Scrivener supports it!

What this post didn’t cover. (aka: I smell a series comin’ on!)

I didn’t go over actually writing in Markdown.

I am assuming if you read this far, you already know how to write in Markdown (which lends easily into MultiMarkdown) and that wasn’t really the point of the this post anyways.

If there is interest, I’d be happy to write another post on how I write in, and rely intrinsically on, Markdown for all of my web publishing. If you’d like to hear more, leave any specifics in the comments below (even if it’s just a “Yes please!”) and I will do my best to accommodate them in a future post.

Hope you found this useful! Now get back to blogging in Scrivener!