Mark’d

I have been flirting with light-weight markup languages for a while, stemming back to 2004 when I began editing Wikipedia in earnest. LMLs let you write things like:

# This is a numbered list
# with two items
#* This one is indented!
# this is the *third* item

and it comes out like this:

  1. This is a numbered list
  2. with two items
    • This one is indented!
  3. this is the third item

without having to write:

<ol><li>This is a numbered list</li>
<li>with two items
<ul><li> This one is indented!</li></ul></li>
<li>this is the <i>third</i> item</li></ol>

I mean, sure, I could click all over and get the same effect, but I like *writing*. In text.

The Mediawiki syntax shown above is pretty nice for things like lists, but things like tables never seem to work right, and for some reason I can never remember the order of the link syntax. So I was looking for an alternative.

Now, TextMate is my preferred text editor for OSX when I don’t feel like hitting Escape constantly–as opposed to vim, which is for when I do, or for use at the CLI and for text manipulation; or WriteRoom, which is for short fiction; or Scrivener, which is for longer fiction; or Pages, which is for layout; or IntelliJ IDEA, for Java, or…

I guess it’s the modern equivalent of a writer having many favorite pens? Anyway.

TextMate doesn’t format text, not really, but it’ll fake a bold or an italic here or there, and do syntax highlighting (crucial for programming). And it’s got plugins that let you work in other languages, originally for the aforementioned syntax highlighting. But they added the ability to fire off special hotkeys that only work in that mode, and do nice things like pick up the headers in your documents and let you navigate by them. The wiki mode wasn’t working for me, so I decided to try Markdown, or rather, MultiMarkdown, a successor that has a few additional (useful) features, like footnotes and citations and poetry mode.

Like wiki-markup (and HTML, and TEX before it, and troff, and so forth), Markdown is meant to be compiled into another format; it’s just that in this case, it gets compiled into HTML, which is then rendered by your browser. Browsers are everywhere, so it makes sense for HTML (+CSS) to be the lingua franca at this point. My car speaks HTML, I’m pretty sure.

TextMate will even let you preview what the document will look like after rendering. But it’s a bit of a slow process, and by slow, I mean, “takes more than a half-second”; you have to hit Ctrl-Opt-Cmd-P, which is a bit of a chord, and then it updates the preview, but it jumps to the top of the document, which is completely useless for eyeballing changes as you make them in anything longer than one page. So I’d given up on using Markdown.

Enter Marked, which I’ve been enjoying the past few days. (Here’s the One Thing Well writeup on it, though that’s not where I found it.) It’s a small Apple Store app, and at $4, priced appropriately. It watches a file on disk and re-renders it whenever you change it. It understands MarkDown and MultiMarkdown, plus text and HTML if you want to go that route. And crucially, it jumps to your latest change, I presume by diffing the files before showing you.

It also lets you specify a custom CSS to decorate the marked-up text (for the non-technical that made it this far: CSS lets you specify things like font size and color; e.g., suppose you want your italic text to also be yellow, for extra emphasis. HTML lets you do this, but you have to do it each time there is italic text. With CSS, you do it once, and you have a lot more control over precisely how it looks). So that’s fun.

I hesitated for a moment, and then I went–DUDE. It’s $4. You’d dither over a mocha for 30 seconds at that price. So, I bought it.

And now I have three windows open: TextMate with the Markdown’d source, the CSS file, and the Marked preview in the background, auto-updating, and I’m cranking out a nicely-formatted file with streamlined source. Yay!

Advertisements

One thought on “Mark’d

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