Manuals | Notion Ruby Mapping Public API Reference | NotionRubyMapping idea note | |
---|---|---|---|
Examples | âŖ | âŖ | update block sample |
<aside>
đĄ This page was created for testing NorionRubyMapping. I thought this page was best suited to explain the update_block API
, so I am presenting it as a use case. The following column_lists are generated by the following method. I will update the block in the left column using update_block API
.
block = ##### create a block #####
column_list_block = page.append_block_children ColumnListBlock.new([block, block])
left_block = column_list_block.children.first.children.first
### the following left_block udpate methods ###
left_block.save
</aside>
<aside> âšī¸ â Table of Contents
</aside>
create blocks
block = BookmarkBlock.new "<https://www.google.com>"
url=()
left_block.url = "<https://www.apple.com/>"
caption.rich_text_objects=()
left_block.caption.rich_text_objects = "Apple"
Apple
create blocks
block = BulletedListItemBlock.new "old text", color: "green_background"
color=()
left_block.color = "orange_background"
rich_text_array.rich_text_objects=()
left_block.rich_text_array.rich_text_objects = "new text"
new text
old text
create blocks
block = CalloutBlock.new "old text", color: "green_background", emoji: "â
"
color=()
left_block.color = "orange_background"