WordPress: How to use Markdown for writing posts

I like the Markdown editor whick is widely used (e.g. This site) and very convenient to use.

How to add a Markdown editor for WordPress? I tried some plugins and find they have their strengthens and disadvantages. Here are my requirements:

  1. Compatible with my existing posts. They should still display well. I can accept minimum editing when it is need and should be rare case.

  2. Editing existing posts should not mess things up. This is a short of some plugins: Wring new posts works well but editin old posts will turn them to a mess.

  3. With a good Markdown editor. An editor helps a lot for Markdown esiting, especially for indenting code.

I ever tried different solutions/plugins. Finally, I settle with a solution by combining 2 plugins to write/edit posts in Markdown in WordPress:

php Markdown

for converting posts written in Markdown to HTML during page serving. Markdown code is saved directly in WordPress. This is different from other solutions that converting Markdown code to HTML before saving and *converting HTML code back to Markdown** when editing—this mess previous posts and new posts if you add HTML/CSS/JavaScript that can not be recognized by the plugins. Hence, I choose php Markdown. It needs a little work to install it. But the tutorial from Michel Fortin is very easy to follow.

Link: http://michelf.ca/projects/php-markdown/

The rendering on the fly uses too much CPU cycles? This is a cost. But I always use WP Super Cache on WordPress.

Markdown QuickTags

for Markdown editing. It is a beautiful and easy to use Markdown editor for WordPress with a set of Markdown buttons. The basic function is editing. Saving the Markdown code of the post in WordPress and use php Markdown to render it when serving the post. Additionally, it can render the Markdown to HTML and HTML to Markdown which, I find, is very useful for editing old posts written in HTML. I like the undo and redo feature much too—we always make mistakes. Especially when rendering HTML to Markdown, we may mess old posts up and the undo feature will save us.

Link: http://wordpress.org/extend/plugins/markdown-quicktags/

Some tools for Markdown:

Markdown syntax: http://daringfireball.net/projects/markdown/syntax

Markdownifier: http://heckyesmarkdown.com/

Leave a Reply

Your email address will not be published. Required fields are marked *