#[non_exhaustive]pub enum DelimitedBlockType {
DelimitedComment(Vec<InlineNode>),
DelimitedExample(Vec<Block>),
DelimitedListing(Vec<InlineNode>),
DelimitedLiteral(Vec<InlineNode>),
DelimitedOpen(Vec<Block>),
DelimitedSidebar(Vec<Block>),
DelimitedTable(Table),
DelimitedPass(Vec<InlineNode>),
DelimitedQuote(Vec<Block>),
DelimitedVerse(Vec<InlineNode>),
DelimitedStem(StemContent),
}Expand description
The inner content type of a delimited block.
Each variant wraps the content appropriate for that block type:
- Verbatim content (
Vec<InlineNode>):DelimitedListing,DelimitedLiteral,DelimitedPass,DelimitedVerse,DelimitedComment- preserves whitespace/formatting - Compound content (
Vec<Block>):DelimitedExample,DelimitedOpen,DelimitedSidebar,DelimitedQuote- can contain nested blocks - Structured content:
DelimitedTable(Table),DelimitedStem(StemContent)
§Accessing Content
Use pattern matching to extract the inner content:
fn process_block(block_type: &DelimitedBlockType) {
match block_type {
DelimitedBlockType::DelimitedListing(inlines) => {
// Handle listing content (source code, etc.)
}
DelimitedBlockType::DelimitedExample(blocks) => {
// Handle example with nested blocks
}
DelimitedBlockType::DelimitedTable(table) => {
// Access table.rows, table.header, etc.
}
// ... other variants
_ => {}
}
}§Note on Variant Names
Variants are prefixed with Delimited to disambiguate from potential future
non-delimited block types and to make pattern matching more explicit.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DelimitedComment(Vec<InlineNode>)
Comment block content (not rendered in output).
DelimitedExample(Vec<Block>)
Example block - can contain nested blocks, admonitions, etc.
DelimitedListing(Vec<InlineNode>)
Listing block - typically source code with syntax highlighting.
DelimitedLiteral(Vec<InlineNode>)
Literal block - preformatted text rendered verbatim.
DelimitedOpen(Vec<Block>)
Open block - generic container for nested blocks.
DelimitedSidebar(Vec<Block>)
Sidebar block - supplementary content in a styled container.
DelimitedTable(Table)
Table block - structured tabular data.
DelimitedPass(Vec<InlineNode>)
Passthrough block - content passed directly to output without processing.
DelimitedQuote(Vec<Block>)
Quote block - blockquote with optional attribution.
DelimitedVerse(Vec<InlineNode>)
Verse block - poetry/lyrics preserving line breaks.
DelimitedStem(StemContent)
STEM (math) block - LaTeX or AsciiMath notation.
Trait Implementations§
Source§impl Clone for DelimitedBlockType
impl Clone for DelimitedBlockType
Source§fn clone(&self) -> DelimitedBlockType
fn clone(&self) -> DelimitedBlockType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more