1 个不稳定版本

0.1.1 2019年6月26日
0.1.0 2019年6月23日

#6 in #cmark

MIT 许可证

1MB
30K SLoC

C 21K SLoC // 0.0% comments · Rust 包仓库 Bitbake 6.5K SLoC // 0.0% comments · Rust 包仓库 Python 1K SLoC // 0.3% comments · Rust 包仓库 OCaml 381 SLoC · Rust 包仓库 XSL 284 SLoC // 0.1% comments · Rust 包仓库 Racket 170 SLoC // 0.1% comments · Rust 包仓库 Rust 138 SLoC · Rust 包仓库 Perl 20 SLoC · Rust 包仓库 C++ 11 SLoC · Rust 包仓库 Ruby 10 SLoC · Rust 包仓库 Batch 8 SLoC · Rust 包仓库 JavaScript 2 SLoC · Rust 包仓库

简单的 cmark-gfm Rust 封装

此包旨在仅涵盖 cmark-gfm 的主要功能。欢迎提出 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

依赖

~0–2.4MB
~47K SLoC