Docs
Docusaurus

Docusaurus

How to use Notion Downloader with Docusaurus.

  1. Follow the instructions in the Docusaurus guide to install Docusaurus.

  2. Install notion-downloader:

npm install notion-downloader
  1. Get your NOTION_TOKEN and ROOT_ID from the Notion Setup guide.

  2. Create the downloader configuration:

    Run npx notion-downloader init and use these options in downloader.json created:

{
  ... 
  "rootObjectType": "database",
  "conversion": {
    ... 
    "markdownExtension": "mdx",
    "outputPaths": {
      "markdown": "./docs",
      "assets": "./static"
    },
    "namingStrategy": {
      "markdown": "githubSlug",
      "assets": "default"
    },
    "layoutStrategy": "hierarchical",
    "frontmatter": {
      "emptyFieldStrategy": "skip"
    }
    ... 
  }
  ... 
}
  1. Add your Notion token:

    a. In a .env file:

    NOTION_TOKEN=your_token_here

    b. Or use it directly with the CLI.

  2. Remove the existing content from the docs folder.

  3. Run the downloader:

npx notion-downloader pull