This would definitely be a non-trivial task. My website uses a non-official version of the notion API to power it (though I’m sure it’s fairly close to the official version). The thing is, notion documents are collections of block-like data structures. Ultimately what that means is they have a unique shape that would be somewhat hard to map over to.
Just to sync to notion someone would need to:
- Parse an updated markdown file via something like remark
- Iterate through the parsed document and transform structures like headings, text attributes, code fences, etc to the notion equivalent
- Create/update the notion document with that structure
After that, you’d have to write a notion-to-markdown converter too. Then you’d have to figure out what sort of hooks to use to ensure the sync works well both ways.
I’m not trying to shoot down your idea. It’s interesting and I’m sure it would be a compelling technical challenge for someone to sink their teeth into. It’d just be a lot of work (and would probably be pretty buggy).