souvikinator / notion-to-md

Convert notion pages, block and list of blocks to markdown (supports nesting and custom parsing)
https://www.npmjs.com/package/notion-to-md
MIT License
1.11k stars 91 forks source link

Support for collapsible content? #36

Closed dotansimha closed 2 years ago

dotansimha commented 2 years ago

first, thank you for a great library!

Seems like the following Notion content:

image

Is being evaluated as:

image

I guess in such cases, we can use the <details>, for example: https://gist.github.com/pierrejoubert73/902cc94d79424356a8d20be2b382e1ab

souvikinator commented 2 years ago

Hey there, Thanks for reporting. Seems like a quick task. Should be available in the next release.

souvikinator commented 2 years ago

Alright, so quick update. I have implemented the logic and it looks something like this:

Notion:

image

Result:

image

However there are few limitations one must be aware of. One cannot use annotations in the toggle text.

souvikinator commented 2 years ago

This feature is available in the latest version (v2.4.0)

dotansimha commented 2 years ago

Amazing! thank you so much!