use offical notion api with notion_client
Convert multiple notion pages to markdown files and try to keep the formatting usable.
don't need download repo, get your Token and export your page:
-
get Internal Integration Token
In https://www.notion.so/my-integrations, create your workspace integration and get token, likesecret_...
-
download package with pip3
pip3 install notion-md
- set env variable or input in your terminal:
export NOTION_TOKEN=your token
export NOTION_PAGES=your main page link
you can select a seperate open page for downloading, and put others page links in this page(use Notion: /Link
command). Then get this page link, make sure you add the integration to your workspace and all your pages your would export.
- download files use notion_md command:
notion_md
pages are saved to notion2md_files dir, default only download files storaged in notion.
export markdown files for Gridea-like blog side, supporting properties of notion database pages eg. Tags, Cover in front yaml.
"url": page.url
"title": page.title
"cover": page cover(None)
"icon": page icon(None)
"created": page created time
"last_edited": page last edited time
# --------for database subpage
"tags": page tags[array]
"categories": page categories
"desc": page description
- normal block(header,list,code,quote,...)
- link page/sub page
- table
- callout
- inline_database(pages)
- image/youtube video/file
- file download(files in notion)
multi-level list items
,bookmarks
, etc. make synchronous network requests, which take longer than other blocks.- only download files in notion, external links will be ignored.
- for database, only download pages in the database.
- children blocks in callouts will be ignored, simple style is better.