I wrote a 10-line program[1] for converting from org-mode format to smsn-mode format. Both formats use indentation to indicate hierarchy. In org, a line at level k (levels are positive integers) starts with k asterisks, followed by a space, followed by the text of the line. In smsn-mode, a line at level k starts with 4*(k-1) spaces, followed by an asterisks, followed by a space.
I feel like there ought to be an intermediate step where it converts the data to something other than string -- for instance,
data IndentedLine = IndentedLine Int String | BadLine
and then generates the output from that. It feels like it needs a parser. But when I resurrect my parser code that I understood many moons ago, it looks like a lot of machinery.
Thanks.
[1] https://github.com/synchrony/smsn-mode/blob/develop/org-to-smsn-mode.hs
--
Jeff Brown | Jeffrey Benjamin Brown