Markdown Comes To WordPress


markdown-example-w-preview (Photo credit: ChrisL_AK)

I have a confession to make. I’m a total nerd when it comes to text and text to HTML conversion systems. You see plain text is just so easy to type and plain text files never cause problems years later when save formats change. Then you just need a way of encoding format in the plain text files.

If you work in a good command line environment there are also a large number of tools that work on plain text files. Unix was actually developed as a document management system – that was how Thompson and Ritchie got the funding to do it from their bosses at Bell.

It was a Unix system, man and mm files, that was my first introduction to specifying formatting in a text file. The drawback of systems such as those that we used under Unix was that they were hard to read – here’s an example of a man file:

\&\fIperldoc\fR looks up a piece of documentation in .pod format that is embedded
in the perl installation tree or in a perl script, and displays it via
\&\f(CW*(Cpod2man | nroff \-man | $PAGER\*(C'\fR. (In addition, if running under HP-UX,
col -x*(C’\fR will be used.) This is primarily used for the documentation for
the perl library modules.

This is a particularly convoluted example but you get the idea – not easy to read.

When web pages came along several projects struggled with a way of making it easier to write web pages with systems that allowed the user to write in simpler syntaxes that were easily translated into HTML. BBCode, from the Universal BBS, was one of the first.

I personally came across one of these style of systems in a wiki back before the turn of the millenium. Then in 2004 John Gruber wrote Markdown. I came to use it as it was available as a plugin for Blosxom, the blogging software I was using at the time.

John was well known in the Mac community so it also got good support with a couple of packages for Mac software such as BBEdit and Textmate. It’s popularity soared when it become well supported on the iPhone and iPad, indeed it’s fairly well established as the default lightweight markup system for iOS with a large number of editors supporting it.

Markdown’s biggest problem was that it only supported a subset of the things that people wanted to encode. A few extensions arose, the best supported one is probably Fletcher Penney’s MultiMarkDown. The one that WordPress has chosen to support is PHP Markdown Extra, popular with blogging and wiki software written in PHP.

Personally I’ve been using Markdown to write my posts for quite a while. I write on my Mac in Byword and then use it’s “Copy HTML” command to get the HTML from my Markdown on the clipboard where I can paste it into the “Text” box in WordPress.

Now I can write in Markdown directly into the Text box. Even better, the text stays as Markdown so I can much more easily make changes such as fixing a spelling error or tweaking the sentence construction.

WordPress have a quick reference page that shows how to use the most common Markdown tags such as bold, italic and web page links. At the same time the Markdown parser supports more than these commands. The ones you are most likely to use are tables and, if you write long posts, special attributes. Have a look at the PHP Markdown Extra page to see how they are used.

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s