BreadCrumbBlock, DividerBlock, TableOfContentsBlock, : NotionRubyMapping 解説 (24)

はじめに

NotionRubyMapping 解説の第24回目です。今日は BreadCrumbBlock, DividerBlock, TableOfContentsBlock をまとめて紹介します。これらはコンテンツを持たない機能のみのブロックです。今日の作業ページはこちらです。

hkob.notion.site

あらかじめページを取得しておきます。

irb(main):002> page = Page.find "https://hkob.notion.site/BreadCrumbBlock-DividerBlock-TableOfContentsBlock-24-1609f4b7c5ca4796ab57638d846bdd87?pvs=4"
=> NotionRubyMapping::Page-1609f4b7c5ca4796ab57638d846bdd87

BreadCrumbBlock

BreadCrumbBlock はパンくずリストのブロックです。

irb(main):003> page.append_block_children BreadcrumbBlock.new
=> NotionRubyMapping::BreadcrumbBlock-e7fe446611984679878db0114f98403d

結果は以下のようになりました。

BreadCrumbBlock

DividerBlock

DividerBlock は区切り線のブロックです。

irb(main):004> page.append_block_children DividerBlock.new
=> NotionRubyMapping::DividerBlock-97974afb8ad642c88593fc9fadf09fc9

結果は以下のようになりました。

DividerBlock

TableOfContentsBlock

TableOfContentsBlock は目次を作成するブロックです。

irb(main):005> page.append_block_children TableOfContentsBlock.new
=> NotionRubyMapping::TableOfContentsBlock-dedaa2481e3448c8b4e0d6cba5bff485

結果は以下のようになりました。

TableOfContentsBlock

おわりに

今回は単なる Block の子クラスである BreadCrumbBlock, DividerBlock, TableOfContentsBlock を解説してみました。今日も外出していたので記事は短めです。すみません。

それぞれのマニュアルはこちら。

hkob.notion.site

hkob.notion.site

hkob.notion.site

NotionRubyMapping解説