Closed m4rrc0 closed 1 year ago
I would like to try looking into this. For this I see two approaches:
false
/null
to return default value, which is similar to the approach that marked takesWhat are your thoughts on this?
I hope @souvikinator can jump in to give input.
Personally, I don't have a strong case for either one of these.
My best guess is that option 2 will be enough for at least 90% of the use cases of this feature.
The 10% remaining can always use blockToMarkdown()
and modify the output as needed before further processing.
Option 1 seems more versatile and may avoid unnecessary data handling outside of n2m
.
Note that if you go with option 1, option 2 shouldn't be too much more work to add on top so implementing both might be a good idea...
Looks like I'm late. @kungpaogao are you working on this? Like @m4rrc0 said, I don't have a strong case for either of them so yea we can go with the second approach. Further issues and requirements can be addressed in the future.
I haven't started yet, but now that you've commented on it, I can start looking into it!
@kungpaogao any update on this?
@souvikinator sorry for the late reply, i implemented it here, but haven't gotten around to testing it: https://github.com/kungpaogao/notion-to-md/tree/kungpaogao/custom-transformer-default
edit: going to take a look rn
Hi. When using
setCustomTransformer
, we may want to transform the output only in some situations. It would be great to be able to return the default n2m output when we need to.Exemple of what it may look like:
Additionally, we may want to only slightly transform the default output and it may make things easier to generate that output string then transform it.