pulldown-cmark-toc
Generate a table of contents from a Markdown document. By default the heading anchor calculation (aka the "slugification") is done in a way that attempts to mimic GitHub's (undocumented) behavior.
Getting started
Add the pulldown-cmark-toc
to your Cargo.toml
.
cargo add pulldown-cmark-toc
Usage
use TableOfContents;
let text = r#"
# Heading
## Subheading
## Subheading with `code`
"#;
let toc = new;
assert_eq!;
}
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.