pub struct Ast {
pub nodes: Vec<Node>,
}Expand description
A parsed Markdown document as a tree of Nodes.
Fields§
§nodes: Vec<Node>Top-level nodes of the document.
Implementations§
Source§impl Ast
impl Ast
Sourcepub fn title(&self) -> Option<String>
pub fn title(&self) -> Option<String>
Returns the title: text content of the first H1 node, if any.
Sourcepub fn mermaid_blocks(&self) -> Vec<&str>
pub fn mermaid_blocks(&self) -> Vec<&str>
Returns the source of every Mermaid fenced-code block, in document order.
A block counts as Mermaid when the first whitespace-delimited token of
its info string is mermaid — so ```mermaid title="Flow" is
matched but ```mermaidjs is not. The walk recurses into
headings, lists, list items, blockquotes, and paragraphs, mirroring the
linter’s visit_nodes, so a diagram nested inside a blockquote or list
item is never missed.
Trait Implementations§
impl StructuralPartialEq for Ast
Auto Trait Implementations§
impl Freeze for Ast
impl RefUnwindSafe for Ast
impl Send for Ast
impl Sync for Ast
impl Unpin for Ast
impl UnsafeUnpin for Ast
impl UnwindSafe for Ast
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