When new features are added into the WordPress.com ecosystem it is a fairly good bet that before long they will be added to the WordPress.org software. Fans of Markdown have been waiting for this addition a long time. However, there are no doubt a large portion of the users who have no idea what Markdown is and why they would ever use it.
While Markdown is new to WordPress.com it has been available to use in WordPress.org for some time with the use of a simple plugin. One of these plugins, which we’ll talk about a little later, has been downloaded almost 25,000 times and has mostly been given a 5 star review by its users.
This tells us that it is popular and well built, but while there are users who love Markdown and the plugin we are going to be discussing, there is still a large percentage of the user base that still don’t know anything about it.
So let’s talk about it now.
What is Markdown?
Markdown is a plain text formatting system created in 2004 by John Gruber and Aaron Swartz. It was developed to allow people to compose richly formatted text for the web. At its most basic, Markdown is a text-to-HTML conversion tool for web writers. When it is used it converts text to structurally valid XHTML and HTML.
It is a system that can be quickly learned due to its simplicity and cuts down on any possible errors that happen when trying to format text with HTML code.
The primary design goal of markdown is to make text as readable as possible. The idea behind its creation was that documents written using the markdown syntax should be publishable as plain text documents without looking like they had been marked up with tags, or any type of HTML formatting.
Why Should I Use Markdown?
Markdown is a very useful tool because it is extremely easy to use and very quick to learn. It makes use of special characters and punctuation to indicate style and links. The characters that are used show how the document will be formatted as well as help style plain text documents for them to be easily viewed. When the document is published to the web these characters are converted to the appropriate style and format.
Writing in Markdown is extremely clean. As you use it the formatting translates to completed HTML styles. You don’t have to worry about missing any closing tags or nesting tags incorrectly. There’s no styling required inline which means you won’t break any of the formatting once it’s published to the web.
It is also a flexible and portable syntax to use. It allows you to output documents to multiple formats. While we are specifically discussing using it with WordPress, it is also easy to create that content offline in a text document and paste it directly into your editing window. This flexibility also allows you to convert it to a styled PDF or other formats without having to make any changes.
Using Markdown With WordPress
While Markdown hasn’t been introduced into the core WordPress software yet, it is extremely easy to add with a single plugin.
There are several plugins you could install to use Markdown on your blog, but in this post I’ll be talking about one called WP-Markdown. Once you have installed and activated the plugin you are then given several new options within the settings menu of the WordPress dashboard.
Under the Settings > Writing menu you can change the options to enable Markdown on posts, pages and comments. This menu allows you to enable the help bar for the post editor and comments as well as enabling a syntax highlighter option to help you get used to using Markdown.
As you use Markdown in your posts, your post editor window is split into two separate sections. The main window is used for writing your post and below this window you are presented with the post, fully styled. This window updates in real time that will allow you to quickly confirm that your styling syntax is correct.
Carrying out the basic styling with Markdown is straightforward. To make convert text into an H1 header tag you need to precede the text with a single hash. H2 headers are preceded with double hashes and each level of header is then marked with an additional hash mark.
Markdown uses asterisks as indicators of emphasis. In order to make a selection of text bold it needs to be wrapped with two asterisks. Emphasizing text with italics is as simple as wrapping the text in single asterisks.
Lists are added using various methods. For unordered lists you can precede list items with a single asterisk, a single plus or a single hyphen. For ordered lists you then simple use the number followed by a period as you would in any normal text document.
Creating links requires a little more thought but can be created really quickly once you are used to the correct syntax. In order to add a link you need to add the link text in between two square brackets and then the link itself should follow this link text in parentheses. An example of this would be: [WPExplorer](http://wpexplorer.com).
When referring to internal pages and posts you simply need to use relative paths for the link rather than the full URL.
Adding images to your post works in a similar way to adding a link. The alt text used on your images is added within the square brackets and the location of the image file is added within the parentheses.
You can also display code block snippets by preceding every line of text within the code block with four spaces. Each additional indent within the code can be styled with a further four spaces to make it easier to read.
Markdown uses email-style > characters to create block quotes. These work best when the each line within block quote is hard wrapped and preceded by the > character.
There are various other syntax options for Markdown and a full run down of them can be found here.
Markdown may not be for everyone. But for those who want a quick and clean method of creating posts without having to worry about HTML or slowing down by removing your hands for the keyboard, it may be a method of writing that suits you.
It isn’t as expansive as using HTML to create your style choices but it will cover a vast majority of them and certainly those style choices that you will use 90% of the time.
Have you used Markdown with WordPress or have you used it in other programs? We’d love to hear you thoughts on Markdown and whether you think it’s a useful tool for WordPress websites.