Skip to content

Commit

Permalink
notion to github guide
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscoMoretti committed Oct 16, 2024
1 parent 91d500c commit 1ed6fae
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 2 deletions.
82 changes: 80 additions & 2 deletions apps/www/content/docs/guide/github.mdx
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
```















4 changes: 4 additions & 0 deletions roadmap.md
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)

0 comments on commit 1ed6fae

Please sign in to comment.