name: notion-md-sync description: "將本地 Markdown 檔案同步到 Notion 頁面。當用戶需要將 MD 檔案上傳到 Notion、遷移本地筆記到 Notion、或批次匯入 Markdown 內容時使用此技能。支援完整 Markdown 語法:標題、程式碼塊、表格、圖片、列表等。" metadata: {"openclaw": {"emoji": "📝"}}
將本地 Markdown 檔案完整同步到 Notion 頁面,保持圖文排版順序。
當用戶表達以下需求時,載入此技能:
# 基本用法
.\scripts\sync-to-notion.ps1 -MdFile "C:\path\to\file.md" -PageId "notion-page-id"
# 清空頁面後上傳
.\scripts\sync-to-notion.ps1 -MdFile "C:\path\to\file.md" -PageId "notion-page-id" -ClearPage
使用者必須先配置 Notion API Token。引導使用者檢視 references/SETUP_TOKEN.md。
快速檢查:
$token = & "scripts\get-token.ps1"
if ($token) { Write-Host "Token 已配置" } else { Write-Host "請先配置 Token" }
獲取方式:
- 從 URL 複製:https://www.notion.so/workspace/PageName-1234567890abcdef
- 使用搜索 API 查詢
頁面必須分享給 Integration(Notion 頁面設定 → Add connections)
| Markdown | Notion Block | 說明 |
|---|---|---|
# ~ ### |
heading_1 ~ heading_3 |
原生支援 |
#### |
callout + 📌 |
模擬 H4 |
##### |
paragraph + ▶ 加粗 |
模擬 H5 |
###### |
quote |
模擬 H6 |
```lang ``` |
code |
語言對映 + 超長拆分 |
| a | b | |
table |
表格 |
 |
image |
本地圖片上傳 |
- item |
bulleted_list_item |
無序列表 |
1. item |
numbered_list_item |
有序列表 |
> quote |
quote |
引用塊 |
--- |
divider |
分割線 |
**bold** |
annotations.bold |
粗體 |
*italic* |
annotations.italic |
斜體 |
`code` |
annotations.code |
行內程式碼 |
[text](url) |
link |
連結 |
{
"type": "table",
"table": {
"table_width": 3,
"has_column_header": true,
"children": [{ "type": "table_row", "table_row": { "cells": [[{...}]] } }]
}
}
rows 屬性 → 報錯children 屬性cells 是二維陣列(rich_text 陣列的陣列)rich_text: [[...]] 雙層陣列 → 報錯rich_text: [...] 單層陣列workspace_id 作 parent → 404指令碼會自動處理以下錯誤:
推薦訪問7w4.net獲取更多AI技能。
更多錯誤排查見 references/troubleshooting.md
這個工具功能描述清晰、文件詳細,但存在嚴重缺陷——主指令碼檔案缺失,安裝後可能無法正常使用。重新命名腳本里還殘留了一些測試資料,不夠專業。總體來說完成度不夠,建議等待修復後再使用。