Cobertos / md2notion

A better Notion.so Markdown importer
MIT License
655 stars 65 forks source link

Support append and update to parent page, not just child page creation. #10

Closed acg closed 4 years ago

acg commented 4 years ago

Fixes #9. Adds three modal options: --append, --update, and --create (the default and current behavior). This lets you modify the parent page instead of always creating a new child page. If you pass --update, the parent page's nodes will first be soft-removed so they can be replaced.

Cobertos commented 4 years ago

Oh noooo, I had the code in my repo last night, I just had to push it ;-;

I'll go through this later today tho

acg commented 4 years ago

Ha! No worries. Note that this does more than --append, it also does --update, which is probably the most common operation for me and I'm guessing others. Nice work putting this together btw!

Cobertos commented 4 years ago

Yeah, #3 was wanting to do a similar thing, but it felt out of scope, but it sounds like there's enough desire to have at least some sort of smart replace.

Maybe instead of --update, we can call it --clear-previous, and instead of removing every child, just removing any child PageBlock that matches the same name as the MD file? Does that sound good to you? I can implement this real quick, and it feels a bit safer and more inline with expectations if say, someone changes their MD file and expects the changes to persist

Cobertos commented 4 years ago

Alright, implemented in https://github.com/Cobertos/md2notion/pull/11, let me know how that looks.

Cobertos commented 4 years ago

This should be resolved in #11