Skip to content

Add methods for modfifing pages and blocks #59

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

dmweis
Copy link

@dmweis dmweis commented Apr 11, 2023

Hey!

This is a larger PR because it wasn't originally meant to be a single PR. I was trying to use your library for something and I couldn't figure out how to modify things so I forked it and ended up making multiple changes.

Together thought they effectively add an API for modifying pages and blocks which as far as I could tell originally wansn't possible. So they might make sense as a signgle PR.

Let me know what you think. If you like all of it I am happy to do some changes, add tests,... whatever else. But if you think only some subsets of this PR should be considered please let me know and I am happy to break it up into separate PRs.

Individual things done:

  • Add update_page to update contents of an existing page
  • Add get_block get block by block id (which can be a page id as pages are also blocks as far as contents are concerned?)
  • Add get_block_children_with_cursor which lets you iterate over children of a block. I wans't sure how to use the existing cursor to iterate without this
  • Add append_block_children which allows user to attach more block under a block or a page
  • Add delete_block which is pretty self explanatory
  • Add update_block which is useful for doing things like changing text content or status of a checkbox but can't do things like change block types
  • Implement Pageable for SearchRequest because I couldn't figure out how to page over results of a serach for pages

Lastly I also changed some API types by adding skip_serializing_if on None, Default, or Clone. This was all just to make working with them easier and because I think we were generating json that notion wasn't happy in some cases.

Thanks!

@failable
Copy link

Any news of this?

@dmweis
Copy link
Author

dmweis commented Apr 27, 2023

Any news of this?

Sorry, not sure if you are asking me?

I think this is waiting for input from a reviewer.

@binarycrayon
Copy link

binarycrayon commented Nov 6, 2023

been a while now, hope the project owner can get back to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants