由于需要将输入的markdown内容转换成html,所以找到了这个包:MarkdownPapers

Maven依赖:

1
2
3
4
5
<dependency>
<groupId>org.tautua.markdownpapers</groupId>
<artifactId>markdownpapers-core</artifactId>
<version>${use latest}</version>
</dependency>

使用起来非常简单:

示例
1
2
3
4
5
Reader in = new FileReader("in.md");
Writer out = new FileWriter("out.html");

Markdown md = new Markdown();
md.transform(in, out);