-
Notifications
You must be signed in to change notification settings - Fork 18
Merge blocks with same type together and handle Notion limits on children and text length #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't aware of the children limit, so thanks for bringing it up.
Unfortunately the current implementation breaks all bulleted and numbered lists as those need to have items as separate Notion blocks.
Could you consider merging similar text blocks together after parsing the blocks?
I limited merging the blocks only to text types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a tiny bug in the latest revision.
Also, after playing a bit more with this behaviour, I think that merging paragraphs to bypass the block count limitation should rather be a config option, e.g.:
[notion]
merge_paragraphs=False
because the native behaviour to Notion is to have each paragraph as a separate block. Merging all paragraphs in one block by default makes editing less convenient.
Added! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs just one last touch, adding the option to the Config
object at line 183:
self.merge_paragraphs = ini['notion']['merge_paragraphs'].lower(
) == 'true'
with that change in place everything works like a charm!
No description provided.