Skip to content
A cmark java wrapper library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A cmark java wrapper library

Cmark-java is a java library that converts Commonmark Markdown to HTML. Under the covers, cmark-java uses cmark by John MacFarlane (one of the authors of the commonmark spec) to do its job.


With cmark-java, converting md to html is as easy as:

Wrapper wrapper = new Wrapper();
String md = "# first heading\n## second heading\n";
String html = wrapper.convert(md);

will print


The code above asumes that cmark is on your systems search path. If it is not, then you have to tell Wrapper() where cmark (the executable binary) lives:

Wrapper wrapper = new Wrapper("C:\\Program Files\\cmark\\cmark.exe");


Cmark must be installed on your system. You can find precompiled binaries for Windows and Linux 64bit in this repository, see precompiled/<os_type> folder. The Windows version is compiled and tested under Windows 7. It's a 32bit executable and should run on both 64bit and 32bit systems. The Linux version is compiled and tested on Debian 7 amd64.

For other os types (Linux 32bit, MacOS, Solaris, etc.), please refer to cmark for build instructions.


Christoph Vilsmeier is the author of cmark-java. John MacFarlane is the main author of cmark.

You can’t perform that action at this time.