diff --git a/apps/www/config/docs.ts b/apps/www/config/docs.ts index 92f5428..7625ce2 100644 --- a/apps/www/config/docs.ts +++ b/apps/www/config/docs.ts @@ -27,8 +27,8 @@ export const docsConfig: DocsConfig = { items: [], }, { - title: "Notion Token", - href: "/docs/notion-token", + title: "Notion Setup", + href: "/docs/notion-setup", items: [], }, { diff --git a/apps/www/content/docs/guide/nextra.mdx b/apps/www/content/docs/guide/nextra.mdx index 2e3e5c2..f20acc1 100644 --- a/apps/www/content/docs/guide/nextra.mdx +++ b/apps/www/content/docs/guide/nextra.mdx @@ -33,15 +33,11 @@ npm install notion-downloader } } ``` +4. Your root Notion object should be a database with a page titled "index". You can start from [this template](https://franciscomoretti.notion.site/11a047149aef80578303e705001bb90e?v=8446592daa4c4e7ab8c2c73cae646e27). -4. Get your NOTION_TOKEN by following the guide in the [Notion Token documentation](https://nextra.site/docs/notion-token). +5. Get your `NOTION_TOKEN` and `ROOT_ID` by following the guide in [Notion Setup](/docs/notion-setup/). -5. Your root Notion object should be a database with a page titled "index". You can start from [this template](https://franciscomoretti.notion.site/11a047149aef80578303e705001bb90e?v=8446592daa4c4e7ab8c2c73cae646e27). - -6. Get the `rootId` from your page following the guide in `/notion-root-id.mdx`. - - -7. Create the downloader configuration: +6. Create the downloader configuration: 1. Run `notion-downloader init` 2. Use the following options in your `downloader.json` file: @@ -73,13 +69,26 @@ npm install notion-downloader } ``` + +7. **Add your Notion token** + Refer to the [Notion Token Setup](/docs/notion-setup) guide for instructions on obtaining your Notion token. Once you have your token, you can use it in one of two ways: + + a. Add it to a `.env` file in your project root: + + ```bash + NOTION_TOKEN=your_token_here + ``` + + b. Use it directly with the CLI. + + 8. Run the downloader: ```bash npm run download ``` -9. **Videos:** For compatibility with server rendering, follow the [Video Support guide](https://nextra.site/docs/guide/video). +9. **Videos:** For compatibility with server rendering, follow the [Video Support guide](/docs/guide/video). 10. **Images:** If any images come from external domains, update your `next.config.mjs` file: diff --git a/apps/www/content/docs/notion-token.mdx b/apps/www/content/docs/notion-setup.mdx similarity index 66% rename from apps/www/content/docs/notion-token.mdx rename to apps/www/content/docs/notion-setup.mdx index ede442d..216e967 100644 --- a/apps/www/content/docs/notion-token.mdx +++ b/apps/www/content/docs/notion-setup.mdx @@ -29,3 +29,19 @@ After creating the integration, you need to give it access to the specific pages Now your integration can access this page/database and its children. Remember: You need to add the integration to the root page/database of the tree you want to download. + +## Getting your Root ID + +Get the ID of the page you want to use as the root of the download. +The downloader will pull all the pages and databases underneath this root. + +Each page from notion has a unique ID. To find the ID of the page you want to use as the root of your downloader, you can follow these steps: + +1. Open the page in Notion +2. Copy the ID from the URL + +The ID is the long string of numbers and letters after `notion.site/` in the URL. + +Example: https://notion.so/franciscomoretti/11a047149aef80578303e705001bb90e?v=8446592daa4c4e7ab8c2c73cae646e27 + +In this case, the root ID is `11a047149aef80578303e705001bb90e`. diff --git a/apps/www/content/docs/usage.mdx b/apps/www/content/docs/usage.mdx index bde2c81..2df85c9 100644 --- a/apps/www/content/docs/usage.mdx +++ b/apps/www/content/docs/usage.mdx @@ -7,7 +7,9 @@ description: How to use the Notion Downloader. Follow these steps to use the Notion Downloader: -1. **Initialize your project** +1. Get your `NOTION_TOKEN` and `ROOT_ID` by following the guide in [Notion Setup](/docs/notion-setup/). + +2. **Initialize your project** Run the following command to create a `downloader.json` configuration file: ```bash @@ -16,11 +18,11 @@ Follow these steps to use the Notion Downloader: This will prompt you for the required configuration options and create a `downloader.json` file in your current directory. -2. **Configure downloader.json (Optional)** +3. **Configure downloader.json (Optional)** If needed, customize your `downloader.json` file by following the [Configuration Guide](/docs/config). -3. **Set up your Notion token** - Refer to the [Notion Token Setup](/docs/notion-token) guide for instructions on obtaining your Notion token. Once you have your token, you can use it in one of two ways: +4. **Add your Notion token** + Refer to the [Notion Token Setup](/docs/notion-setup) guide for instructions on obtaining your Notion token. Once you have your token, you can use it in one of two ways: a. Add it to a `.env` file in your project root: @@ -28,9 +30,10 @@ Follow these steps to use the Notion Downloader: NOTION_TOKEN=your_token_here ``` - b. Use it directly with the CLI (see step 4). + b. Use it directly with the CLI (see step 5). + -4. **Download your Notion content** +5. **Download your Notion content** Run one of the following commands to pull your Notion content: a. If you've set up your token in a `.env` file: