Why is Markdown Cool? (It might write better HTML than your's.)

I went to the UseR conference, and R-Markdown was all the rage. My boss/coworker/?? asked me what was so cool about it. I've been using plain Markdown around a year, and think it's kind of cool, but my initial impression was that Markdown was kind of lame.

After all, HTML isn't that hard. Additionally, it's not that hard to write a parser that detects paragraphs, links, and even image links - so you can get most of Markdown without special syntax. You can actually guess these things pretty accurately. So what exactly does Markdown get you that the above options don't?

1. Markdown produces perfect HTML as output, and accepts pretty much any text as input. This allows you to write HTML parsers or do DOM queries without having to deal with exceptional situations. You can use an XML parser library that requires perfect XML.

2. R-Markdown lets you insert code into the text, and then execute it and embed the results back into the document. You don't embed Javascript. Like #1, this layer of parsing is good because you can assure that the code is good.

The alternatives to 1 and 2 are to allow HTML, and filter it, and allow Javascript, and filter it. It's hard to filter HTML and Javascript that users insert. (While Markdown can pass HTML through, you can get rid of that feature.)

3. It's much easier to implement a Markdown workflow than to make one based around Word docs, TeX, or PDF files.