rasendubi/uniorg

[feat] uniorg-stringify

tefkah opened this issue · 4 comments

Hi there! Do you think it would be possible to have an uniorg-stringify function, which turns the uniorg-ast back into an org-file? For org-roam-ui I would eventually want to include an editing function, probably using Slate, but having an editor means little if we wouldn't be able to apply those edits to the text.

I would be more than willing to help develop this (I would need to create a uniorg<->slate transformer anyway), but having worked with unified a bit with other projects I've noticed that writing parsers/etc are not my forte haha, so I thought I'd ask here first!

Thanks for the great work as always!

Hey! I would love to have uniorg-stringify in uniorg as it has been sitting on my todo list for quite a while now. I'm busy now but I might have time in two weeks. If you want to jump in earlier, I can help or provide guidance.

One question: do you need to preserve whitespace when editing? uniorg-parse does not store empty lines between paragraphs, so the naive (and simple!) implementation of uniorg-stringify might collapse multiple empty lines in one, add empty lines between elements, etc. I think that's fine for an MVP though…

Amazing! I personally don't care about retaining whitespace and don't use it for anything meaningful in my Org files, so I think it's fine. For an MVP it's definitely more than fine!

I think remark does preserve whitespace and in an ideal world I think it would be good to modify the files as little as possible, but definitely not a priority for me.

You're a madman! Fantastic, that's so much faster than I could have hoped, you're amazing!