cmark-gfm

Crates.iocmark-gfm
lib.rscmark-gfm
version0.1.1
sourcesrc
created_at2019-06-23 21:55:13.841745
updated_at2019-06-26 07:54:46.855642
descriptionRust wrapper of libcmark-gfm
homepage
repositoryhttps://github.com/HelloEdit/rust-cmark-gfm
max_upload_size
id143071
size14,794
Corentin Poupry (HelloEdit)

documentation

README

Simple cmark-gfm Rust wrapper

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

Commit count: 3

cargo fmt