RubyGreenBlue

Markdown template handler for rails

Posted by keith over 2 years ago
Vote for this article on digg.com: Digg It!

Writing is all about content. Style and presentation is a separate concern. When I am writing, be it for the web or some documentation or whatever, I like to write pure text. Style and presentation comes later.

Markdown allows me to do that very effectively. I get to concentrate purely on the content of what I am writing and the semantics of the content (this is a heading, this is a list, this should be emphasised...)

For me, this desire to write plain text extends to writing content for web sites. Of course, html has it place but if I am writing a content page for a client's web site, I would much rather just write the content and not have the html markup of that content get in my way.

I solved this by writing a rails markdown template handler so I could write web site content in my rails apps in markdown.

These two images show a rails view (this site's about page) as html and markdown. In the markdown version, the content is free of the clutter of html tags.

The code is released under the MIT licence and can be found at the markdown_template_handler project home