Cobertos / md2notion

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

Upload creates new blocks on subsequent runs #3

Closed coryodaniel closed 4 years ago

coryodaniel commented 4 years ago

Running the upload command against a PageBlock results in duplicate files on subsequent runs.

python -m md2notion.upload [token_v2] [page-url] ./docs/*.md

Results in:

Running it again, will append additional files instead of updating the existing ones.

python -m md2notion.upload [token_v2] [page-url] ./docs/*.md

Results in:

coryodaniel commented 4 years ago

Thanks by the way. This is a pretty awesome tool!

Cobertos commented 4 years ago

That was a pain point for me as well. Unfortunately I see no easy way to implement this feature. There's a lot of things the user can do with the documents between generations that would make the algorithm to match up previous pages to newly generated ones either very flaky or very challenging to write, test, and maintain.

For my use cases, I've been writing custom scripts to delete the old posts and make new ones or just deleting them by hand.

I'm open to ideas and PRs though.

coryodaniel commented 4 years ago

Yeah I'm not positive either. I ended up writing a markdown file to notion page title function and I use that to look up the page and replace it if its there or create a new one. 🤷‍♂

Cobertos commented 4 years ago

Yeah, I think I'd rather leave this as a tool to just convert and upload into Notion. If the end user wants to remove old notes or something else, they can write that in their own script.

Closing as won't fix, but if someone has a compelling reason im open to more discussion

Cobertos commented 4 years ago

@coryodaniel

Ended up maybe fixing your issue? If you wanted to take a look at https://github.com/Cobertos/md2notion/pull/11