-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91d500c
commit 1ed6fae
Showing
2 changed files
with
84 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,84 @@ | ||
--- | ||
title: GitHub | ||
description: How to use Notion Downloader with GitHub. | ||
description: Notion to GitHub with notion-downloader. | ||
--- | ||
|
||
TBD | ||
|
||
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](https://github.com/FranciscoMoretti/notion-to-github). | ||
|
||
## Steps | ||
|
||
1. Install `notion-downloader`: | ||
|
||
```bash | ||
npm install notion-downloader | ||
``` | ||
|
||
2. Get your `NOTION_TOKEN` and `ROOT_ID` from the [Notion Setup](/docs/notion-setup/) guide. | ||
|
||
3. Create the downloader configuration: | ||
|
||
Run `npx notion-downloader init` and use these options in `downloader.json` created: | ||
|
||
```json | ||
{ | ||
... | ||
"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. | ||
4. Add your Notion token: | ||
|
||
a. In a `.env` file: | ||
```bash | ||
NOTION_TOKEN=your_token_here | ||
``` | ||
|
||
b. Or use it directly with the CLI. | ||
|
||
5. Run the downloader: | ||
|
||
```bash | ||
npx notion-downloader pull | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# A list of todos in no particular order | ||
|
||
- [ ] List items inside toggles need an extra space after summary (Found on notion-to-github) | ||
- [ ] Optionally don't print frontmatter (good for notion-to-github) |