Sync local Markdown files to Notion with full formatting support. Use when user wants to backup, sync, or migrate files to Notion, mentions uploading to Notion, or says sync to Notion...
Automatically sync local Markdown files to Notion while preserving directory structure and full Markdown formatting.
Before using this skill:
Install dependencies in the skill directory:
cd banana-sync-to-notion
npm install
Configure environment variables by creating a .env file:
NOTION_TOKEN=your_notion_integration_token
NOTION_ROOT_PAGE_ID=target_page_id
NOTION_TOKEN: Get from Notion IntegrationsNOTION_ROOT_PAGE_ID: The parent page ID where files will be syncedRun from the skill directory:
npm run sync:notion
This command:
Files/ in project root)Remove all child pages under the target page:
npm run clean:notion
Use this before a fresh re-sync.
Clean existing content and sync fresh:
npm run resync:notion
Combines clean:notion + sync:notion.
All standard Markdown syntax is converted to native Notion blocks:
| Syntax | Notion Output |
|---|---|
**bold** or __bold__ |
Bold text |
*italic* or _italic_ |
Italic text |
***bold italic*** |
Bold italic |
`code` |
Inline code |
[text](url) |
Clickable link (http/https only) |
```language ... ``` |
Code block |
- item or * item |
Bullet list |
1. item |
Numbered list |
> quote |
Quote block |
> š” note |
Callout (emoji-prefixed quotes) |
--- or *** |
Divider |
| Markdown tables | Native Notion tables |
Relative Links:
./file.md or ../folder/file.md ā Converted to Notion page links./image.png ā Preserved as text (no local file upload)http://... ā Clickable external linksThe script assigns emoji icons based on filename patterns:
Customize icons by editing the selectIcon function in scripts/sync-notion.js.
Duplicate Detection: Automatically skips pages that already exist with the same title, enabling incremental syncs without duplicates.
Smart Chunking:
Progress Reporting: Shows detailed statistics during sync:
š Starting Notion Sync...
š Source: /path/to/Files
š Target Page: My Knowledge Base
š Syncing directory: Files
⨠Creating: š 01-Introduction
š Syncing directory: 01-Introduction
⨠Creating: š 01-overview.md
āļø Skipping existing: 02-concepts.md
⨠Creating: šÆ 03-quickstart.md
==================================================
ā
Sync Complete!
==================================================
ā±ļø Duration: 45.2s
š Statistics:
⢠Files processed: 35
⢠Files created: 25
⢠Files skipped: 10
⢠Folders created: 5
⢠Errors: 0
==================================================
banana-sync-to-notion/
āāā SKILL.md
āāā .env (user created)
āāā package.json
āāā scripts/
ā āāā sync-notion.js # Main sync logic
ā āāā clean-notion.js # Cleanup utility
āāā Files/ (default source directory)
Image support: Current version focuses on text/Markdown. Images require hosted URLs (image hosting) to display in Notion. Local image upload requires more complex authentication.
Missing icons: Files that don't match any icon pattern use the default š emoji. Add custom patterns in scripts/sync-notion.js.
Rate limits: The script includes automatic retry logic for Notion API rate limits. Large syncs (>100 files) may take several minutes.
Relative links not working: Ensure the linked Markdown file was also synced. Links only work to pages that exist in Notion.