Better ruby markdown interpreter?

RubyMarkdown

Ruby Problem Overview


I'm trying to find a markdown interpreter class/module that I can use in a rakefile.

So far I've found maruku, but I'm a bit wary of beta releases.

Has anyone had any issues with maruku? Or, do you know of a better alternative?

Ruby Solutions


Solution 1 - Ruby

I use Maruku to process 100,000 - 200,000 documents per day. Mostly forum posts but I also use it on large documents like wiki pages. Maruku is much faster than BlueCloth and it doesn't choke on large documents. It's all Ruby and although the code isn't especially easy to extend and augment, it is doable. We have a few tweaks and extras in our dialect of Markdown.

If you want something that is pure Ruby, I definitely recommend Maruku.

For the fastest option out there, you probably want RDiscount. The guts are implemented in C.

See also: "Moving Past BlueCloth" on Ryan Tomayko's blog. Ryan's post includes the following benchmark of 100 iterations of a markdown test:

BlueCloth: 13.029987s total time, 00.130300s average
   Maruku: 08.424132s total time, 00.084241s average
RDiscount: 00.082019s total time, 00.000820s average


Update August 2009

BlueCloth2 was released (http://www.deveiate.org/projects/BlueCloth) It's speed is on par with RDiscount because it is based on RDiscount - it is not pure Ruby.

(Thanks Jim)


Update November 2009

Kramdown 1.0 was just released. I haven't tried it yet, but it is a pure-Ruby Markdown parser that claims to be 5x faster than Maruku.


Update April 2011

Maruku hasn't seen a commit since June 2010. You may want to look into Kramdown instead.

A new fast option that is not pure Ruby: GitHub has released Redcarpet, which is based on libupskirt: https://github.com/blog/832-rolling-out-the-redcarpet

Update August 2013

Kramdown is still a very healthy project (based on recent commits, outstanding issues, pull requests) and a great choice for a pure Ruby Markdown engine https://github.com/gettalong/kramdown

Redcarpet is probably still the most commonly used and actively maintained option for people that don't need or want pure Ruby.

Solution 2 - Ruby

The listing at http://ruby-toolbox.com/categories/markup_processors.html would be a good place to start looking.

Solution 3 - Ruby

RDiscount is Fast and simple to use.

Solution 4 - Ruby

Try RDiscount. BlueCloth is slow and buggy.

Solution 5 - Ruby

The benchmark in the answer given by casey use BlueCloth 1. BlueCloth 2 is the fastest these days : http://www.deveiate.org/projects/BlueCloth

Solution 6 - Ruby

I believe BlueCloth is the most prominent one.

Solution 7 - Ruby

Looks like a lot of these answers are outdated.

Best thing I've found out there as of now (summer 2013) is the Redcarpet gem: https://github.com/vmg/redcarpet

Solution 8 - Ruby

To ensure you're getting BlueCloth 2, install like this:

gem install bluecloth

Note that "bluecloth" should be in all lowercase, not camel case.

Source: http://rubygems.org/gems/bluecloth

Solution 9 - Ruby

If you need a fair example for how to use something like Kramdown in a rakefile there is a repo on github with code and articles in markdown.md that can be converted to html with Ruby code syntax highlighting but alas line numbers as well.(I would prefer to turn off line numbering)

If anyone knows how to shut off the line numbering default please tell us.

Anyway the link is https://github.com/elm-city-craftworks/practicing-ruby-manuscripts

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJonathan LonowskiView Question on Stackoverflow
Solution 1 - RubyoutcassedView Answer on Stackoverflow
Solution 2 - RubyJohn DyerView Answer on Stackoverflow
Solution 3 - RubyandreaView Answer on Stackoverflow
Solution 4 - RubyzenaznView Answer on Stackoverflow
Solution 5 - RubyJim SohoView Answer on Stackoverflow
Solution 6 - RubyGordon WilsonView Answer on Stackoverflow
Solution 7 - RubyNealView Answer on Stackoverflow
Solution 8 - RubythdoanView Answer on Stackoverflow
Solution 9 - RubyDouglas G. AllenView Answer on Stackoverflow