Home

Awesome

Prolog-markdown

Markdown parser implemented in Prolog. Compatible with SWI-Prolog as the output tree is for direct use by html//1. The specification for the parser was taken from http://daringfireball.net/projects/markdown/syntax (Gruber's Markdown).

Build Status

Example usage

Parse into a structure usable by html//1.

:- use_module(library(md/md_parse)).

?- md_parse_string("# Hello #", Blocks).
Blocks = [h1("Hello")].

Convert into an HTML string:

:- use_module(library(md/md_parse)).

?- md_html_string("# Hello #", Html).
Html = "<h1>Hello</h1>".

Deviations from the Gruber's Markdown

Performance

Example document (about 800 lines) is parsed in 80ms on 2.4GHz Q6600.

Installation

Requires SWI-Prolog 7.x.

pack_install('http://packs.rlaanemets.com/markdown/markdown-*.tgz')

API documentation

See http://packs.rlaanemets.com/markdown/doc/md_parse.html for the top-level module documentation.

Changelog

Bug reports/feature requests

Please send bug reports/feature request through the GitHub project page.

License

The MIT License. See the LICENSE file.