Cool! Thanks for sharing. Also worth noting that there's a Mac app in the app store to export to markdown or html:
https://apps.apple.com/us/app/exporter/id1099120373?mt=12
(I haven't had a need yet, so I haven't tried it)
https://apps.apple.com/us/app/exporter/id1099120373?mt=12
(I haven't had a need yet, so I haven't tried it)