A cmark java wrapper library
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); System.out.println(html);
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,
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.