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/
The BlueCloth class is a subclass of Ruby’s String, and can be used thusly:
bc = BlueCloth::new( str )
puts bc.to_html
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
..
def content
BlueCloth::new(self.text).to_html
end
..