Markdown With Ruby
2009-11-26 07:48:07 | 0 Comment
I love markdown and I was searching how to use markdown with Ruby for a Rails project and thanks to Ryan Tomayko, a sinatrarb developer, I am now using Discount.
Installation is very easy:
sudo gem install rdiscount
You can give it a try on the Rails shell or IRB. Here is a quick example:
require 'rdiscount'
text = RDiscount.new("This is a **test**.")
text.to_html
And you get:
"<p>This is a <strong>text</strong></p>\n"
Enjoy!

Comments
Leave a Response