- Run on a personal computer : Download a Notion page as a HTML file.
- Run on the cloud : Host a static version of a Notion page on Netlify.
This small application uses the following three of my projects.
- notionapi-agent - Node.js wrapper for Notion's API.
- notionast-util-from-notionapi - Convert Notion's response objects of a page to a special tree structure.
- notionast-util-to-html - Render HTML from the special tree structure.
Also, you can take a look at public/index.html
.
-
Clone this repository.
git clone https://github.com/dragonman225/notion-page-downloader.git
-
Go into the repository.
cd notion-page-downloader
-
If you use
npm
npm install
Or, if you use
pnpm
pnpm install
-
Run setup script.
npm run setup
-
Edit the
notionPageURL
field ofconfig.json
. -
If the Notion page is private, you need to fill in your
token
inconfig.json
. Follow this guide to obtain your token. -
Download the page as
public/index.html
.npm run start
-
To update the static page on Netlify, go to Deploys tab, trigger deploy.
-
Private Notion pages can't be deployed. (Technically, it's possible, but giving your Notion login token to the cloud is dangerous. A Notion token is so powerful that anyone or any machine with it can control your Notion account.)
Please view the list here.
- Delete
node_modules/
andpackage_lock.json
. - Run
npm install
orpnpm install
.