markedj: the best of markdown processor on jvm
TRANSCRIPT
From Scala to JavaLooking for the best markdown parser and markedj
@takezoenBizReach, Inc
10 Oct. 2015 #shibuya_java 13th
Prelude
● We are developing GitBucket which is a Scala based GitHub clone
● It should support markdown for many purpose● We are looking for better markdown processor on JVM
A lot of markdown processors in Java
● pegdown○ https://github.com/sirthias/pegdown
● markdown4j○ https://code.google.com/p/markdown4j/
● MarkdownJ○ https://github.com/myabc/markdownj
● MarkdownPapers○ http://markdown.tautua.org/
● Txtmark○ https://github.com/rjeschke/txtmark
From: http://www.w3.org/community/markdown/wiki/MarkdownImplementations
Problems about GFM support
1. Run following code in REPL:...
2. Result is: ...
Plugin version | GitBucket version:--------------|:-----------------3.6.x | 3.6.x3.5.x | 3.5.x
Table:
Block in list:
```$ mvn clean$ mvn package```
Fence:
Status
Library Table Fence Block in List
Remarks
pegdown ○ ○ × Previously GitBucket were using this.
markdown4j × ○ ○ Plugin systemUML support using YUML
MarkdownJ × × ○
MarkdownPapers × △ ○
Txtmark × △ ○ Highly buggy?
In other languages
● redcarpet (Ruby)○ https://github.com/vmg/redcarpet
● marked.js (JavaScript)○ https://github.com/chjj/marked
Jamie Zawinski said:
Some people, when confronted with a problem, think
"I know, I'll use regular expressions."
Now they have two problems.
Road to markedj
● Many regular expressions and mutables, Why Scala?● Porting to Java may be useful for many people on JVM
○ No Scala runtime library○ Available for Java and any other JVM langs
● I decided to port from Scala to Java!
markedj is JVM port of marked.js
● GitHub Flavored Markdown support● Simple and extensible API● GitBucket switches to markedj in the next version (3.7)!
import io.github.gitbucket.markedj.Marked;
String markdown = ...
String html = Marked.marked(markdown);
markedj is a graceful markdown processor on JVM. Try it!!
https://github.com/gitbucket/markedj