pub enum ElementKind {
Show 18 variants
Empty,
Heading {
level: u8,
text: Vec<TextSegment>,
section_id: usize,
collapsed: bool,
},
HeadingBorder {
level: u8,
},
CodeBlockHeader {
language: String,
blockquote_depth: usize,
},
CodeBlockContent {
content: String,
highlighted: Option<Text<'static>>,
line_number: usize,
blockquote_depth: usize,
},
CodeBlockBorder {
kind: CodeBlockBorderKind,
blockquote_depth: usize,
},
Paragraph(Vec<TextSegment>),
ListItem {
depth: usize,
ordered: bool,
number: Option<usize>,
content: Vec<TextSegment>,
},
Blockquote {
content: Vec<TextSegment>,
depth: usize,
},
TableRow {
cells: Vec<String>,
is_header: bool,
alignments: Vec<ColumnAlignment>,
},
TableBorder(TableBorderKind),
HorizontalRule,
Frontmatter {
fields: Vec<(String, String)>,
collapsed: bool,
},
FrontmatterStart {
collapsed: bool,
context_id: Option<String>,
},
FrontmatterField {
key: String,
value: String,
},
FrontmatterEnd,
Expandable {
content_id: String,
lines: Vec<MarkdownElement>,
max_lines: usize,
collapsed: bool,
total_lines: usize,
},
ExpandToggle {
content_id: String,
expanded: bool,
hidden_count: usize,
},
}Expand description
Represents the kind of markdown element.
Variants§
Empty
Empty line (default).
Heading
Heading with level (1-6).
Fields
§
text: Vec<TextSegment>HeadingBorder
Border below heading.
CodeBlockHeader
Code block header with language.
CodeBlockContent
Code block content line (plain text or syntax highlighted).
Fields
CodeBlockBorder
Code block border (top, middle, bottom).
Fields
§
kind: CodeBlockBorderKindParagraph(Vec<TextSegment>)
Paragraph text with formatting.
ListItem
List item with nesting level.
Blockquote
Blockquote with nesting depth.
TableRow
Table row.
TableBorder(TableBorderKind)
Table border.
HorizontalRule
Horizontal rule.
Frontmatter
YAML frontmatter (collapsible) - legacy single-block format. Contains the parsed fields as key-value pairs.
Fields
FrontmatterStart
Frontmatter top border with collapse icon.
Fields
FrontmatterField
A single frontmatter field (key: value).
FrontmatterEnd
Frontmatter bottom border.
Expandable
Expandable content block (e.g., “Show more” / “Show less”).
Fields
§
lines: Vec<MarkdownElement>The content to display (already markdown elements)
ExpandToggle
Show more / Show less toggle button.
Trait Implementations§
Source§impl Clone for ElementKind
impl Clone for ElementKind
Source§fn clone(&self) -> ElementKind
fn clone(&self) -> ElementKind
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 ElementKind
impl Debug for ElementKind
Source§impl Default for ElementKind
impl Default for ElementKind
Source§fn default() -> ElementKind
fn default() -> ElementKind
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ElementKind
impl RefUnwindSafe for ElementKind
impl Send for ElementKind
impl Sync for ElementKind
impl Unpin for ElementKind
impl UnsafeUnpin for ElementKind
impl UnwindSafe for ElementKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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