更好的ruby markdown解释器? [英] Better ruby markdown interpreter?

查看:84
本文介绍了更好的ruby markdown解释器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到可以在rakefile中使用的markdown解释器类/模块.

到目前为止,我已经找到了 maruku ,但是我对Beta版本有些警惕.

有人对maruku有任何疑问吗?或者,您知道更好的选择吗?

解决方案

我每天使用Maruku处理100,000-200,000个文档.大多数情况下是论坛帖子,但我也将其用于大型文档,如Wiki页面. Maruku比BlueCloth快得多,并且不会在大型文档上窒息.全部都是Ruby,尽管代码不是特别容易扩展和扩充,但它是可行的.我们在Markdown的方言中有一些调整和附加功能.

如果您想要的是纯Ruby ,我绝对推荐Maruku.

对于其中的最快选项,您可能需要RDiscount.胆量是用C实现的.

另请参见:"

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


2009年8月更新

BlueCloth2已发布( http://www.deveiate.org/projects/BlueCloth ) 它的速度与RDiscount相当,因为它基于RDiscount-它不是纯Ruby.

(感谢 Jim )


2009年11月更新

Kramdown 1.0刚刚发布.我还没有尝试过,但是它是一个纯Ruby Markdown解析器,声称比Maruku快5倍.


2011年4月更新

自2010年6月以来,Maruku就再也没有见过提交承诺了.您可能想研究一下Kramdown.

不是纯Ruby的新快速选项:GitHub已发布Redcarpet,它基于libupskirt: https://github.com/blog/832-rolling-out-the-redcarpet

2013年8月更新

Kramdown仍然是一个非常健康的项目(基于最近的提交,未解决的问题,请求请求),并且是纯Ruby Markdown引擎的绝佳选择 https://github.com/gettalong/kramdown

对于不需要或想要纯Ruby的人来说,Redcarpet仍然可能是最常用和主动维护的选项.

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?

解决方案

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.

这篇关于更好的ruby markdown解释器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆