pub enum ContentBlock {
Heading {
level: usize,
content: String,
inline: Vec<InlineElement>,
anchor: Option<String>,
},
Paragraph {
content: String,
inline: Vec<InlineElement>,
},
Code {
language: Option<String>,
content: String,
start_line: usize,
end_line: usize,
},
List {
ordered: bool,
items: Vec<ListItem>,
},
Blockquote {
content: String,
blocks: Vec<ContentBlock>,
},
Table {
headers: Vec<String>,
alignments: Vec<TableAlignment>,
rows: Vec<Vec<String>>,
},
Image {
alt: String,
src: String,
title: Option<String>,
},
HorizontalRule,
Details {
summary: String,
content: String,
blocks: Vec<ContentBlock>,
},
}Expand description
A parsed content block in a markdown document.
These represent the block-level structure of markdown content, similar to an AST but optimized for consumption by tools like treemd.
Variants§
Heading
A heading (# H1, ## H2, etc.)
Paragraph
A paragraph of text
Code
A fenced or indented code block
List
An ordered or unordered list
Blockquote
A blockquote (> text)
Table
A table with headers and rows
Image
An image (standalone, not inline)
HorizontalRule
A horizontal rule (—, ***, ___)
Details
HTML block
Trait Implementations§
Source§impl Clone for ContentBlock
impl Clone for ContentBlock
Source§fn clone(&self) -> ContentBlock
fn clone(&self) -> ContentBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContentBlock
impl Debug for ContentBlock
Source§impl<'de> Deserialize<'de> for ContentBlock
impl<'de> Deserialize<'de> for ContentBlock
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ContentBlock
impl PartialEq for ContentBlock
Source§impl Serialize for ContentBlock
impl Serialize for ContentBlock
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ContentBlock
Auto Trait Implementations§
impl Freeze for ContentBlock
impl RefUnwindSafe for ContentBlock
impl Send for ContentBlock
impl Sync for ContentBlock
impl Unpin for ContentBlock
impl UnwindSafe for ContentBlock
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