1 unstable release
0.1.1 | Jun 26, 2019 |
---|---|
0.1.0 |
|
#6 in #cmark
1MB
30K
SLoC
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
Dependencies
~0–3MB
~52K SLoC