An open API service indexing awesome lists of open source software.

https://github.com/jdan/notion-script-blocks

script blocks in notion
https://github.com/jdan/notion-script-blocks

Last synced: 3 months ago
JSON representation

script blocks in notion

Awesome Lists containing this project

README

          

## script-blocks

"Script" "Blocks" in [Notion](https://notion.so)

### Usage

As a heads up, this barely works at all.

Get started by duplicating [my public "script blocks" template](https://jdan.notion.site/Script-blocks-template-cb43702f8d0e4113bce926529bd12d71). 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](https://developers.notion.com/docs/getting-started#step-1-create-an-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](https://developers.notion.com/docs/getting-started#step-2-share-a-database-with-your-integration)
- Run the script

```sh
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
```

### Hackerz

`eval` is dangerous. `eval` on a node server is even more dangerous. Don't share your pages with the internet.

a code block with the script