You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@BenBlumer I used the concept from #91 to write my own notion-to-html renderer that makes parsing blocks significantly easier (see renderer.py and build.py - the latter implements the former but also performs a number of unrelated tasks).
The renderer has been built in a way that a markdown implementation could theoretically be added without too much difficulty - the only problem is that there are a lot of block types that are unsupported by markdown, and a few which notion-py doesn't seem to know how to handle (renderer.md).
Notion's "export to markdown" does have the same limitations, excluding user/date mentions which do work (I am yet to implement these successfully, but I believe they are possible). Most embeds/tables etc. that don't translate across to markdown are just exported as links.
I've only just finished building this for use with my own website, if I get some time I'll extract it into its own repo and extend it a bit more.
If as you were talking about in the other issue you opened you can get directly accessing the notion export-to-markdown endpoint that's probably quicker/simpler, but hey, I saw this and couldn't help replying.
@BenBlumer, I've actually just made Notoma — a CLI tool to export Notion -> Markdown, based on this library. Let me know if it helps (or sucks)?
I'll add images, embeds, and links to other pages support tomorrow and release a new version on pypi. The way it's built is iterating through page blocks, and it expects a database as a list of pages to export.
Does anyone have a suggested strategy for programatically exporting notion docs as markdown?
I've seen the md2notion package for going the opposite direction. Is there a way to pull it directly from Notion?
If I have to, I can parse and convert each block on a page, but given that it's built into Notion's "Export" menu, there must be a better way.
The text was updated successfully, but these errors were encountered: