Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

markedj: The best of markdown processor on JVM

4,629 views

Published on

markedj is JVM port of graceful markdown processor marked.js
https://github.com/gitbucket/markedj

Published in: Software
  • Be the first to comment

markedj: The best of markdown processor on JVM

  1. 1. From Scala to Java Looking for the best markdown parser and markedj @takezoen BizReach, Inc 10 Oct. 2015 #shibuya_java 13th
  2. 2. 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
  3. 3. 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
  4. 4. Problems about GFM support 1. Run following code in REPL: ... 2. Result is: ... Plugin version | GitBucket version :--------------|:----------------- 3.6.x | 3.6.x 3.5.x | 3.5.x Table: Block in list: ``` $ mvn clean $ mvn package ``` Fence:
  5. 5. Status Library Table Fence Block in List Remarks pegdown ○ ○ × Previously GitBucket were using this. markdown4j × ○ ○ Plugin system UML support using YUML MarkdownJ × × ○ MarkdownPapers × △ ○ Txtmark × △ ○ Highly buggy?
  6. 6. In other languages ● redcarpet (Ruby) ○ https://github.com/vmg/redcarpet ● marked.js (JavaScript) ○ https://github.com/chjj/marked
  7. 7. Road to markedj ● At first, I started porting marked.js into Scala
  8. 8. Regular expressions!!
  9. 9. Jamie Zawinski said: Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
  10. 10. Side-effect! Mutable!! Not functional!!! Reassign!! Break!! Mutable stack!!
  11. 11. 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!
  12. 12. 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);
  13. 13. markedj is a graceful markdown processor on JVM. Try it!! https://github.com/gitbucket/markedj

×