jakeswenson / notion

Notion Offical API client library for rust
https://crates.io/crates/notion
MIT License
127 stars 61 forks source link

Add new CreateBlock children to page creation #49

Closed markacola closed 1 year ago

markacola commented 1 year ago

There are quite a few changes here, so please let me know if I've gone down the wrong path. Open to working on changing the whole approach 😁

I thought it would be helpful to reuse existing page content, so I implemented Into<CreateBlock> for Block to allow this.

The new CreateBlock struct avoids the BlockCommon that isn't needed for creating a page. I think CreateBlock or Block could just be a macro over the other, but I thought duplication was cheaper in this case as the Into<CreateBlock> also links them together.