Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Markdown to HTML with Java/Scala

I am aware of following projects (mostly from http://www.w3.org/community/markdown/wiki/MarkdownImplementations):

implemented in 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?)

implemented in 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

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?

like image 259
Erich Schreiner Avatar asked Nov 05 '13 08:11

Erich Schreiner


1 Answers

The fantastic microbenchmark tool created by MarkdownPapers' author compares the performance for the following implementations:

  • MarkdownPapers
  • PegDown
  • Knockoff
  • MarkdownJ
  • TxtMark

TxtMark far exceeds the performance of the other tools, as shown in the following graph:

Performance comparisons of markdown implementations

PegDown, which supports many GitHub extensions and others, is far more fully featured. Custom plugins or extensions are also possible.

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.

like image 187
adarshr Avatar answered Oct 08 '22 13:10

adarshr