问题描述
什么是降价以C或C ++?
我通过谷歌找到了这些,并且将AP preciate评论有关哪些运作良好,哪些没有(和哪些我可能已经错过了):
- (原libupskirt)
-
取决于能说会道,其他第三部分的工具。我测试过它,它工作得很好。
优点:
- GPL和麻省理工学院下的双重授权。
- 使用内部正式的语法,所以容易维护和扩展。
缺点:
- 取决于GLib的
- 提供C API。
-
,大多数C ++ code,但它是相当慢,有点臃肿。在另一方面,它是很容易理解和修改,取决于升压1.35。
优点
- 在升压只依赖
- 用C ++编写,貌似不太危险
- MIT授权。
劣势
- 慢(但仍快约10倍,那么Perl实现,但折扣比慢约10倍)
-
,这是code我用我的博客和wiki http://art-blog.no-ip.info/wikipp/en/page/main.它是由铁杆C程序员,相当难以mantainable(即使开发商activly保持它)。
写优点
- 极快
- 用纯C(无第三部分依赖)。
- 积极维护
- 的宽容3 clause BSD许可证
劣势
- 几乎不可能维持(甚至我可以删除/添加一些素质特征分析)。
- 的唯一文件API,所以我应该调整的code,使其与一般的缓冲合作。
为什么我知道他们这么多?
我开发的,所以我需要一个好的降价到HTML转换器。当我拿起一(折扣),这是唯一的解决方案。从那时起,我需要它取代因授权问题。尽管如此,我还是挺喜欢它,因为它是最快的降价方案。
P.S:如果你想C ++包装的折扣,采取http://cppcms.svn.sourceforge.net/viewvc/cppcms/cms/trunk/cxxmarkdown/,它不是最新版本,但它已经被调整。
编辑:我刚刚访问折扣网站,我发现,它已经增加了一个非文件API为好。因此,现在是真正的图书馆。
编辑2:如果您找到更好的实现或写在FOSS许可证自己,让我知道;)
修改3:为cloose评论,折扣改变了许可证3条第BSD
What is the best implementation of Markdown for C or C++?
I found these via Google, and would appreciate comments about which ones work well and which ones don't (and which ones I may have missed):
- peg-markdown
- Discount
- Cpp-Markdown
- libsoldout (formerly libupskirt)
peg-markdown depends on GLib and other 3rd part tools. I've tested it, it works quite well.
Advantages:
- Dual-licensed under GPL and MIT.
- Uses internally formal grammar, so easy to maintain and extend.
Disadvantages:
- Depends on GLib
- Provides C API.
Cpp-Markdown, Most C++ code but it is quite slow and little bit bloated. On the other hand it is quite easy to understand and modify, Depends on boost-1.35.
Advantages
- Depends only on boost
- Written in C++, looks like less dangerous
- Licensed under MIT.
Disadvantages
- Slow (it is still about 10 times faster then Perl implementation, but about 10 times slower than Discount)
Discount, This is the code I use for my blog http://art-blog.no-ip.info/cppcms/blog and wiki http://art-blog.no-ip.info/wikipp/en/page/main. It is written by hardcore C programmer and quite hardly mantainable (even the developer activly maintains it).
Advantages
- Extremely fast
- Written in pure C (no 3rd part dependencies).
- Actively maintained
- Has permissive 3 clause BSD license
Disadvantages
- Almost impossible to maintain (even I could remove/add some fatures).
- .
Why do I know them so much?
I'm developing CppCMS, so I need a good markdown to HTML convertor. When I picked one (Discount), it was the only solution. Since then I've needed to replace it due to licensing issues. That said, I still quite like it because it is the fastest Markdown solution.
P.S.: If you want C++ wrapper for Discount, take a look on http://cppcms.svn.sourceforge.net/viewvc/cppcms/cms/trunk/cxxmarkdown/, It is not the latest version, but it is already tweaked.
EDIT: I have just visited Discount site and I had found that it had added a non-FILE API as well. So now it is real library.
EDIT 2: If you find better implementation or write your own under FOSS license, let me know ;)
EDIT 3: as cloose commented, discount had changed the license to 3 clause BSD.
这篇关于降价为实现C / C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!