addChildren: Add children blocks to parent blocks that have not yet been...

Description Usage Arguments Details Value Examples

View source: R/addChildren.R

Description

addChildren facilitates adding children blocks to parent blocks that have not yet been posted (providing the block type allows children). Currently this includes "paragraph", "bulleted_list_item", "numbered_list_item", "toggle", "to_do", "quote", "callout", "synced_block", "template", "column", "child_page", and "child_database".

Usage

1
addChildren(parentBlock, ...)

Arguments

parentBlock

Data frame. The parent block to add children to.

...

Data frame representing Notion content to add to parent block. May accept multiple blocks.

Details

To add children to blocks that are already posted, use patchAppendBlocks.

Value

Data frame object representing the Notion block object.

Examples

1
2
3
4
5
6
7
toggleBlock <- createTextBlock("toggle","Outer toggle text")
stuffForToggle <- createTextBlock("paragraph", "inner toggle text")
moreStuffForToggle <- createTextBlock("quote", "Woof woof")
finalToggleBlock <- addChildren(toggleBlock, stuffForToggle, moreStuffForToggle)
## Pipe-friendly
finalToggleBlock <- createTextBlock("toggle","Outer toggle text") %>%
addChildren(createTextBlock("paragraph", "inner toggle text"), moreStuffForToggle)

burrowsdt/r2notion documentation built on Jan. 5, 2022, 4:10 p.m.