pub enum AnchorStyle {
GitHub,
KramdownGfm,
Kramdown,
PythonMarkdown,
}Expand description
Anchor generation style for heading fragments
Variants§
GitHub
GitHub/GFM style (default): preserves underscores, removes punctuation
KramdownGfm
Kramdown with GFM input: matches Jekyll/GitHub Pages behavior Accepts “kramdown-gfm”, “kramdown_gfm”, and “jekyll” (for backward compatibility)
Kramdown
Pure kramdown style: removes underscores and punctuation
PythonMarkdown
Python-Markdown style: used by MkDocs (NFKD → ASCII, collapse separators)
Implementations§
Source§impl AnchorStyle
impl AnchorStyle
Sourcepub fn for_flavor(flavor: MarkdownFlavor) -> Self
pub fn for_flavor(flavor: MarkdownFlavor) -> Self
The anchor generation a flavor’s renderer performs natively.
Used when the user has not pinned anchor-style, so a document is
checked against the anchors its own platform emits. per-file-flavor
makes this a per-document answer, so resolve it from the flavor the file
is parsed with rather than from the global one.
Sourcepub fn generate_fragment(&self, heading: &str) -> String
pub fn generate_fragment(&self, heading: &str) -> String
Generate an anchor fragment using the specified style
Trait Implementations§
Source§impl Clone for AnchorStyle
impl Clone for AnchorStyle
Source§fn clone(&self) -> AnchorStyle
fn clone(&self) -> AnchorStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more