notion-to-md icon indicating copy to clipboard operation
notion-to-md copied to clipboard

Child Page Reference in `toMarkdownString()` with `separateChildPage = true`

Open damourChris opened this issue 2 months ago • 0 comments

Hey! Just started using this library and loving it so far!

I am running into an issue and was wondering if this was intentional or not.

When converting a Page with Child Pages with toMarkdownString() (config option separateChildPage = true), there is no markup left in the parent page content indicating that a the child page was there.

From the example: 237184886-531ef45d-2dc7-47f4-bbb3-12d6fd44d299 237185157-7dde090b-7333-46f8-b6df-e6c9a7b62fa9

The current output is: { "parent": "\nThis is parent page content \n\n\nback to the parent page\n\n [...rest of the output...], "Level 1 page: ": "\nThis is a level 1 page [..rest of the output...] }

However, in my situation it would ideal if the output look like this: { "parent": "\nThis is parent page content \n\n**[Level 1 page](/level-1-page)**:\nback to the parent page\n\n [...rest of the output...], "Level 1 page: ": "\nThis is a level 1 page [..rest of the output...] }

The markup it self doesn't have to exacly this but the ability to add a reference to the child page would be amazing.

Is this intentional or a missing feature?

Implementing this would (I believe) look like this: https://gist.github.com/damourChris/f3de3c46378a8e3ab169ea4055fb2c22

Thank for you work!

damourChris avatar Apr 17 '24 14:04 damourChris