Crate pulldown_cmark_toc
source ·Expand description
Generate a table of contents from a Markdown document.
Examples
use pulldown_cmark_toc::TableOfContents;
let text = "# Heading\n\n## Subheading\n\n## Subheading with `code`\n";
let toc = TableOfContents::new(text);
assert_eq!(
toc.to_cmark(),
r#"- [Heading](#heading)
- [Subheading](#subheading)
- [Subheading with `code`](#subheading-with-code)
"#
);Structs
- Represents a heading.
- Configuration options to use when rendering the Table of Contents.
- Represents a Table of Contents.
Enums
- Which symbol to use when rendering Markdown list items.