使用 Java/Scala 将 Markdown 转换为 HTML
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19784525/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Markdown to HTML with Java/Scala
提问by Erich Schreiner
I am aware of following projects (mostly from http://www.w3.org/community/markdown/wiki/MarkdownImplementations):
我知道以下项目(主要来自http://www.w3.org/community/markdown/wiki/MarkdownImplementations):
implemented in Java:
用Java实现:
- txtmark http://github.com/rjeschke/txtmark(claims to be fastest MD processor running on the JVM)
- Markdown4j http://code.google.com/p/markdown4j(fork of txtmark, advantages? more active dev?)
- MarkdownPapers http://markdown.tautua.org/(based on JavaCC parser)
- pegdown http://github.com/sirthias/pegdown
- MarkdownJ http://code.google.com/p/markdownj(abandoned?)
- txtmark http://github.com/rjeschke/txtmark(声称是运行在 JVM 上最快的 MD 处理器)
- Markdown4j http://code.google.com/p/markdown4j(txtmark的分支,优点?更活跃的开发者?)
- MarkdownPapers http://markdown.tautua.org/(基于 JavaCC 解析器)
- pegdown http://github.com/sirthias/pegdown
- MarkdownJ http://code.google.com/p/markdownj(已放弃?)
implemented in Scala:
在 Scala 中实现:
- Laika https://github.com/planet42
- Actuarius http://henkelmann.eu/projects/actuarius/(acc. to author not fully standards compliant)
- Knockoff http://tristanhunt.com/projects/knockoff(only subset of MD?)
- ScalaMD https://github.com/chirino/scalamd
- 莱卡https://github.com/planet42
- Actuarius http://henkelmann.eu/projects/actuarius/(根据作者不完全符合标准)
- 仿冒http://tristanhunt.com/projects/knockoff(仅 MD 的子集?)
- ScalaMD https://github.com/chirino/scalamd
Q:What are the respective performance characteristics, pitfalls, quirks? Which ones support the Github extensions? Which one would you recommend for a Play! / Scala application?
问:各自的性能特点、缺陷和怪癖是什么?哪些支持 Github 扩展?你会推荐哪一个玩!/ Scala 应用程序?
采纳答案by adarshr
The fantastic microbenchmark toolcreated by MarkdownPapers' author compares the performance for the following implementations:
MarkdownPapers 的作者创建的出色的微基准测试工具比较了以下实现的性能:
- MarkdownPapers
- PegDown
- Knockoff
- MarkdownJ
- TxtMark
- 降价纸
- 钉住
- 仿冒品
- 降价J
- 文本标记
TxtMark far exceeds the performance of the other tools, as shown in the following graph:
TxtMark 的性能远远超过其他工具,如下图所示:
PegDown, which supports many GitHub extensions and others, is far more fully featured. Custom plugins or extensions are also possible.
PegDown 支持许多 GitHub 扩展和其他扩展,功能更加全面。自定义插件或扩展也是可能的。
My use case involved processing markdown from an administrative screen where performance was less impactful than a rich feature set, which meant PegDown won over TxtMark.
我的用例涉及从管理屏幕处理降价,其中性能的影响不如丰富的功能集,这意味着 PegDown 胜过 TxtMark。