Convert an exported Notion page Markdown file to Scrapbox page text
It converts a Notion unique Markdown file to md2sb compatible one, then encodes it to Scrapbox style text using md2sb.
It also extracts images and upload them to Gyazo, then replace the image links with Gyazo url.
$ npm install -g @tommy6073/notion2sb
- Export Notion workspace from "Settings & members" -> "Settings" -> "Export content" -> "Export all workspace content" with options set to following:
- Export format: Markdown & CSV
- Include content: Everything
- Create folders for subpages: On
- Unzip exported zip file to somewhere.
GYAZO_ACCESS_TOKENenvironment variable to your Gyazo OAuth access token. You can get it from https://gyazo.com/oauth/applications. It'll be used for uploading images in a page to gyazo.com.
- Execute notion2sb with an argument which is a path to the Notion page .md file to convert
Write to stdout
$ notion2sb '/Users/tnagatomi/Export-0b036b8c-1cdf-4481-811f-209d2480627c/Page 1 bca29e3a1793444ea56b27e1b8486347/Sub page 1 731aae2b15064faca1cfdc564119e8a9.md'
Write to a file
$ notion2sb '/Users/tnagatomi/Export-0b036b8c-1cdf-4481-811f-209d2480627c/Page 1 bca29e3a1793444ea56b27e1b8486347/Sub page 1 731aae2b15064faca1cfdc564119e8a9.md' > sb_page.txt