Ruby on Rails
BlueCloth

BlueCloth is a Ruby implementation of Markdown. This allows you generate valid XHTML formatted text from easy to read source text.

Read more about it here:
http://www.deveiate.org/projects/BlueCloth

Read more about Markdown here:
http://daringfireball.net/projects/markdown/

Example Usage

The BlueCloth class is a subclass of Ruby’s String, and can be used thusly:

<pre> bc = BlueCloth::new( str ) puts bc.to_html </pre>

Chances are, you’ll have a model holding a text to be BlueCloth’ed. Use following definition to have a clean way to call ie. @article.content in your view;

article.rb
..
<pre> def content BlueCloth::new(self.text).to_html end
..