"Script" "Blocks" in Notion
As a heads up, this barely works at all.
Get started by duplicating my public "script blocks" template. There, you'll find that script blocks have an incredibly specific format (subject to change).
> (gear icon) script name
## script
--
[code block]
## input
--
[at least one line of text]
--
## ouput
[empty line - this is where the output will go]
[empty line (yes, another one!)]
Then in Notion, do the following:
- Create a new Notion integration
- Create a new page and note its ID from the address bar
https://www.notion.so/[username]/[your page ID!]
- Share that page with your new integration
- Run the script
git clone https://github.com/jdan/notion-script-blocks.git
npm i
NOTION_SECRET=[your token here] NOTION_PAGE=[your id here] node main.js
eval
is dangerous. eval
on a node server is even more dangerous. Don't share your pages with the internet.