<aside> 💡 This command assumes that the enviroment variable NOTION_API_KEY contains your integration key. Please set this environment variable before execution.

# bash, zsh
export NOTION_API_KEY=secret_..........

# fish
set -gx NOTION_API_KEY secret_.......

</aside>

notionErDiagram.rb creates Sitemap from your Notion page. After invite your integration to your pages and type command as follows. This script is very slow because it retrieves and maps all blocks and TextObjects.

Pattern1: use id, LR orientation, without page link


notionSitemap.rb top_page_id code_block_id LR --nolink 
Example:
  notionSitemap.rb d6c72b00cb7945a8b2823510f238b1ae 7ef956ae012d4d5aa7cae30179552e36 LR --nolink
flowchart LR
p0(5/2 Notion によるページ作成データ構造の概念JSON を使った API アクセス) --> p1(1. Notion について) & p2(2. Notion を使ってみるページ作成) & p3(3. Notion を使ってみるデータベース) & p4(4. Notion を使ってみる リレーション) & p5(5. JSONの記述方法を学ぶページ情報を取得) & p6(6. API によるページ更新作成)
click p0 "<https://www.notion.so/5-2-Notion-JSON-API-d6c72b00cb7945a8b2823510f238b1ae>"
click p1 "<https://www.notion.so/1-Notion-fbacdf4cf24343668ebe491572f68f59>"
click p2 "<https://www.notion.so/2-Notion-7b9d18e6919e46aba28d10cefce19e1b>"
click p3 "<https://www.notion.so/3-Notion-8b77cf3aad4f4ab2a686d2b3cbbf8ee1>"
click p4 "<https://www.notion.so/4-Notion-26287b5e529047929c1071b8a44bda50>"
click p5 "<https://www.notion.so/5-JSON-97d077d68e674da286cac415695b5957>"
click p6 "<https://www.notion.so/6-API-f8defdc1f47d41dc8e425afb5bbb75b3>"

Pattern2: use url (require quote), TD orientation

# Pattern2: use url (requre quote), TD orientation
  notionErDiagram.rb "database_url" "code_block_url"

Example:
  notionSitemap.rb "<https://www.notion.so/hkob/5-2-Notion-JSON-API-d6c72b00cb7945a8b2823510f238b1ae>" "<https://www.notion.so/hkob/NotionSitemap-sample-14e195c83d024c5382aab09210916c87#315b4c3c0c424e5897277bbc445e9a4c>" TD
flowchart TD
p0(5/2 Notion によるページ作成データ構造の概念JSON を使った API アクセス) --> p1(1. Notion について) & p2(2. Notion を使ってみるページ作成) & p3(3. Notion を使ってみるデータベース) & p4(4. Notion を使ってみる リレーション) & p5(5. JSONの記述方法を学ぶページ情報を取得) & p6(6. API によるページ更新作成)
click p0 "<https://www.notion.so/5-2-Notion-JSON-API-d6c72b00cb7945a8b2823510f238b1ae>"
click p1 "<https://www.notion.so/1-Notion-fbacdf4cf24343668ebe491572f68f59>"
click p2 "<https://www.notion.so/2-Notion-7b9d18e6919e46aba28d10cefce19e1b>"
click p3 "<https://www.notion.so/3-Notion-8b77cf3aad4f4ab2a686d2b3cbbf8ee1>"
click p4 "<https://www.notion.so/4-Notion-26287b5e529047929c1071b8a44bda50>"
click p5 "<https://www.notion.so/5-JSON-97d077d68e674da286cac415695b5957>"
click p6 "<https://www.notion.so/6-API-f8defdc1f47d41dc8e425afb5bbb75b3>"
p1 -.-> p7(タスクリストサンプル ) & p8(逆引きNotion) & p2
p2 -.-> p3
p3 -.-> p4
p4 -.-> p5
p5 -.-> p6