pub struct ParsedBlock {Show 19 fields
pub spans: Vec<ParsedSpan>,
pub heading_level: Option<i64>,
pub list_style: Option<ListStyle>,
pub list_indent: u32,
pub list_prefix: String,
pub list_suffix: String,
pub marker: Option<MarkerType>,
pub is_code_block: bool,
pub code_language: Option<String>,
pub blockquote_depth: u32,
pub line_height: Option<i64>,
pub non_breakable_lines: Option<bool>,
pub page_break_before: Option<bool>,
pub direction: Option<TextDirection>,
pub background_color: Option<String>,
pub alignment: Option<Alignment>,
pub top_margin: Option<i64>,
pub text_indent: Option<i64>,
pub semantic_role: Option<SemanticRole>,
}Expand description
A parsed block (paragraph, heading, list item, code block)
Fields§
§spans: Vec<ParsedSpan>§heading_level: Option<i64>§list_style: Option<ListStyle>§list_indent: u32§list_prefix: StringOrdered-list delimiter prefix (e.g. "(" for djot (1) lists; empty
otherwise). Stored on the List entity for round-trip fidelity.
list_suffix: StringOrdered-list delimiter suffix ("." for 1., ")" for 1)/(1);
empty for unordered lists).
marker: Option<MarkerType>Task-list checkbox marker (djot - [ ] / - [x]). Maps to
Block.fmt_marker. None for non-task blocks.
is_code_block: bool§code_language: Option<String>§blockquote_depth: u32§line_height: Option<i64>§non_breakable_lines: Option<bool>§page_break_before: Option<bool>Start this block on a new page (djot {page_break_before=true}). Maps to
Block.fmt_page_break_before. None when absent.
direction: Option<TextDirection>§background_color: Option<String>§alignment: Option<Alignment>Paragraph alignment (djot {alignment=left|right|center|justify}). Maps
to Block.fmt_alignment. None when no alignment attribute is present.
top_margin: Option<i64>This block’s own space-above (djot {top_margin=<int>}). Maps to
Block.fmt_top_margin and overrides the document-wide paragraph
spacing for this block alone. None when absent.
text_indent: Option<i64>This block’s own first-line indent (djot {text_indent=<int>}). Maps to
Block.fmt_text_indent and overrides the document-wide first-line
indent for this block alone. None when absent.
semantic_role: Option<SemanticRole>The enclosing blockquote’s semantic role (djot {semantic_role=epigraph}),
written on the quote’s first block because block attributes are the only channel
djot offers. The importer lifts it onto the Frame, where it belongs.
Implementations§
Source§impl ParsedBlock
impl ParsedBlock
Sourcepub fn is_inline_only(&self) -> bool
pub fn is_inline_only(&self) -> bool
Returns true when this block carries no block-level formatting,
meaning its content is purely inline.
Trait Implementations§
Source§impl Clone for ParsedBlock
impl Clone for ParsedBlock
Source§fn clone(&self) -> ParsedBlock
fn clone(&self) -> ParsedBlock
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more