Cobertos / md2notion

A better Notion.so Markdown importer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upload creates new blocks on subsequent runs

coryodaniel opened this issue · comments

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:

  • doc-1.md
  • doc-2.md

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:

  • doc-1.md
  • doc-2.md
  • doc-1.md
  • doc-2.md

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

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.

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. 🤷‍♂

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

@coryodaniel

Ended up maybe fixing your issue? If you wanted to take a look at #11