Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Intro to Notion API' example #441

Merged

Conversation

jessmitch42
Copy link
Contributor

@jessmitch42 jessmitch42 commented Aug 14, 2023

Adds a new example to the /examples directory. There was a request to have more code samples that build up in complexity so each section has a simple version that gets progressively more complex.
There will be an advanced section added in a future PR (likely some existing examples moved over here to organize them a bit more).
This can be easily expanded as more requests come in; for example, the current /basic files can be grouped into a blocks subdirectory if other "basic" examples get requested.

Note: Part of the request was to heavily comment this code here.

@jessmitch42 jessmitch42 marked this pull request as draft August 14, 2023 20:53
@jessmitch42 jessmitch42 reopened this Aug 31, 2023
@jessmitch42 jessmitch42 marked this pull request as ready for review September 4, 2023 14:34
@jessmitch42 jessmitch42 self-assigned this Sep 4, 2023
@jessmitch42 jessmitch42 added the examples Issues related to `examples` label Sep 4, 2023
@jessmitch42 jessmitch42 requested review from a team and parulbaweja and removed request for a team September 4, 2023 14:38
parulbaweja
parulbaweja previously approved these changes Sep 5, 2023
Copy link
Contributor

@parulbaweja parulbaweja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple questions, but lgtm!

`NOTION_PAGE_ID`: Use the ID of any Notion page that you want to test adding content to.

The page ID is the 32 character string at the end of any page URL.
![A Notion page URL with the ID highlighted](./assets/page_id.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be an example Notion page URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is!

}

// After adding pages, query the database entries (pages)
queryDatabase(databaseId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be useful to add console.log("Querying database...")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure thing, just added :)

@jessmitch42
Copy link
Contributor Author

Hey @parulbaweja thanks for the review. I added your suggestion so it looks like it needs another review. If everything looks good, do you mind merging it too after approving? I don't have permissions to merge in this repo 🥲

@parulbaweja parulbaweja enabled auto-merge (squash) September 6, 2023 21:03
@parulbaweja parulbaweja merged commit 3bf8bfc into makenotion:main Sep 6, 2023
4 checks passed
rhart92 pushed a commit that referenced this pull request Oct 3, 2023
* add new example (wip)

* update readme

* add intermediate example

* add more comments and resources to each example

* add additional resources section

* rename some files for consistency, clean up readme, more console logs

* make linter happy

* readme updates

* clean up links

* add console for querying
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Issues related to `examples`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants