Crates.io | cmark-gfm |
lib.rs | cmark-gfm |
version | 0.1.1 |
source | src |
created_at | 2019-06-23 21:55:13.841745 |
updated_at | 2019-06-26 07:54:46.855642 |
description | Rust wrapper of libcmark-gfm |
homepage | |
repository | https://github.com/HelloEdit/rust-cmark-gfm |
max_upload_size | |
id | 143071 |
size | 14,794 |
This crates has been developed to cover only the main functions of cmark-gfm
. Feel free to propose PR!
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);
}
MIT