cmark-gfm 0.1.1

Rust wrapper of libcmark-gfm
Documentation

This crates has been developed to cover only the main functions of cmark-gfm. Feel free to propose PR!

Example

extern crate cmark_gfm;

use cmark_gfm::{Options, Parser, Render};

fn main() {
    let text = &"# Hello world";

    let mut options = Options::empty();
    options.insert(Options::CMARK_OPT_FOOTNOTES);

    let parser = Parser::new(options);

    let extensions = &["table", "strikethrough", "autolink", "tasklist"];
    for extension in extensions {
        parser.add_extension(extension).unwrap();
    }

    parser.parse(text);
    let result = Render::to_html(&parser);

    println!("Output : {}", result);
}

License

MIT