pub struct MarkdownParser { /* private fields */ }Expand description
Markdown parser for parsing and rendering markdown documents
Implementations§
Source§impl MarkdownParser
impl MarkdownParser
Sourcepub fn with_options(options: MarkdownOptions) -> Self
pub fn with_options(options: MarkdownOptions) -> Self
Create a new markdown parser with custom options
Sourcepub fn extract_toc(content: &str) -> Vec<TocEntry>
pub fn extract_toc(content: &str) -> Vec<TocEntry>
Extract table of contents headings from markdown content.
Returns heading level (1-6), slug, and text for each heading found outside of code blocks.
Sourcepub fn extract_embeds(content: &str) -> Vec<EmbedBlock>
pub fn extract_embeds(content: &str) -> Vec<EmbedBlock>
Extract embed blocks !{type id} from content.
Recognized types: youtube, vimeo, figma, mermaid, plantuml, codepen, github. Skips content inside code blocks.
Sourcepub fn extract_block_references(
&self,
content: &str,
) -> Vec<(usize, BlockReference)>
pub fn extract_block_references( &self, content: &str, ) -> Vec<(usize, BlockReference)>
Extract block references (transclusions) from markdown content.
Parses ![[target]], ![[target#heading]], ![[target#^block-id]] syntax.
Skips references inside code blocks and inline code.
Returns the block references found and their positions.
Sourcepub fn extract_wikilinks(content: &str) -> Vec<String>
pub fn extract_wikilinks(content: &str) -> Vec<String>
Extract all wikilink targets from content (without converting)
Sourcepub fn parse<S: AsRef<str>>(
&self,
markdown: S,
format: OutputFormat,
) -> Result<RenderResult>
pub fn parse<S: AsRef<str>>( &self, markdown: S, format: OutputFormat, ) -> Result<RenderResult>
Parse markdown content
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MarkdownParser
impl RefUnwindSafe for MarkdownParser
impl Send for MarkdownParser
impl Sync for MarkdownParser
impl Unpin for MarkdownParser
impl UnsafeUnpin for MarkdownParser
impl UnwindSafe for MarkdownParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more