Docs
GitHub
GitHub
Notion to GitHub with notion-downloader.
How to set up a GitHub repository that uses notion-downloader
to pull content from Notion.
Notion to GitHub with notion-downloader
This guide explains how to set up a GitHub repository that uses notion-downloader
to pull content from Notion.
- Reference template repository: https://github.com/FranciscoMoretti/notion-to-github.
Steps
- Install
notion-downloader
:
npm install notion-downloader
-
Get your
NOTION_TOKEN
andROOT_ID
from the Notion Setup guide. -
Create the downloader configuration:
Run
npx notion-downloader init
and use these options indownloader.json
created:
{
...
"rootObjectType": "page",
"conversion": {
...
"pageLinkHasExtension": true,
"markdownPrefixes": {
"markdown": "",
"assets": ""
},
"layoutStrategy": {
"markdown": "hierarchical",
"assets": "hierarchical"
},
"namingStrategy": {
"markdown": "githubSlug",
"assets": "default"
}
...
}
...
}
Name your root page
README
for it to be featured on the repository home page.
-
Add your Notion token:
a. In a
.env
file:NOTION_TOKEN=your_token_here
b. Or use it directly with the CLI.
-
Run the downloader:
npx notion-downloader pull