mengu on web programming.

Markdown With Ruby

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!

Tags: markdown, ruby

Comments

No comments made for this post.

Leave a Response

No HTML allowed. You can use markdown.
Name*:
E-Mail* (not published):
Web site:
Response: