Skip to main content

integrate_section_blocks

Function integrate_section_blocks 

Source
pub fn integrate_section_blocks(
    doc: &mut Document,
    target_section: &BlockId,
    source_doc: &Document,
    base_heading_level: Option<usize>,
) -> Result<Vec<BlockId>>
Expand description

Integrate blocks from a source document into a target section.

This takes all non-root blocks from the source document and adds them as children of the target section, preserving their relative hierarchy.

§Arguments

  • doc - The target document to modify
  • target_section - The section to add blocks to
  • source_doc - The source document containing blocks to integrate
  • base_heading_level - Optional base level for heading adjustment

§Returns

  • Ok(Vec<BlockId>) - List of added block IDs
  • Err(Error) - If the target section doesn’t exist