https://github.com/thinkerchan/notion2md
Convert Notion database to markdown files automatically & periodically
https://github.com/thinkerchan/notion2md
Last synced: 3 months ago
JSON representation
Convert Notion database to markdown files automatically & periodically
- Host: GitHub
- URL: https://github.com/thinkerchan/notion2md
- Owner: thinkerchan
- Created: 2024-09-23T07:16:18.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-03-24T00:30:31.000Z (4 months ago)
- Last Synced: 2025-03-24T01:27:52.896Z (4 months ago)
- Homepage: https://post.testdog.cn/
- Size: 41 KB
- Stars: 105
- Watchers: 0
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# notion2md
notion2md is a github action workflow to conver Notion Database to Markdown file automatically. feel free to use it on your blog or anywhere you want.
## Screenshots

notion database
markdown file## Requirements
### 1. create a notion database
you can simply duplicate this [demo db](https://thinkrchan.notion.site/10ae95237d4b8023add0d42c858d464f?v=fffe95237d4b8162bc57000ce467f9df) as a template### 2. get notion token and database id
- go to https://www.notion.so/profile/integrations to get notion token
- db id like : ă10ae95237d4b8023add0d42c858d464fă in [demo db](https://thinkrchan.notion.site/10ae95237d4b8023add0d42c858d464f?v=fffe95237d4b8162bc57000ce467f9df) url
- token connection
### 3. fork this repo & create github tokens
- click to fork [this repo](https://github.com/thinkerchan/notion2md/fork)
- github token: Settings -> Secrets and variables -> Actions -> New repository secret
- fill your NOTION_DATABASE_ID and NOTION_TOKEN according to the values that you get from your notion## Local try
> create .env file like below once you have cloned the repo on your local machine```txt
# .env file on the root directory
NOTION_TOKEN=your_token
NOTION_DATABASE_ID=your_db_id
``````js
// set CONFIG as below in `.github/workflows/notion2md.js` if you want
const CONFIG ={ //default values
days: 7,
dir:'./posts',
filename:'weekly news'
}
``````bash
# then run the dev command
npm i
npm run dev
```## How to collect
- install [save-to-notion](https://chromewebstore.google.com/detail/save-to-notion/ldmmifpegigmeammaeckplhnjbbpccmm) to your browser
- then select the notion database you created
- fill the form and click save
## Cases
- [tpl repo - Weekly ](https://github.com/thinkerchan/weekly) (you can just fork this repo directly)