Sunday, March 6, 2011

Better ruby markdown interpreter?

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?

From stackoverflow
  • I believe BlueCloth is the most prominent one.

  • Try RDiscount. BlueCloth is slow and buggy.

    Christian Lescuyer : It isn't anymore. It now uses the C discount library. http://www.deveiate.org/projects/BlueCloth
  • 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.

    Rob : gave you +1 because you put in the Update section!
  • The benchmark in the answer given by casey use BlueCloth 1. BlueCloth 2 is the fastest these days : http://www.deveiate.org/projects/BlueCloth

    casey : Thanks Jim - I updated my answer.

0 comments:

Post a Comment