cheapskate
cheapskate copied to clipboard
Serialize `Doc` back into a `Text` value
We are sometimes using cheapskate to parse existing markdown, but other times we are using it to generate markdown of our own instead of concatenating a bunch of strings. The downside is that once you have a Doc
, there doesn't seem to be a way to get the underlying Text
back, for things like storing it in a database or passing it into text editors.
A render :: Doc -> Text
function would be fantastic, although maybe Blocks -> Text
would be more appropriate as the Options
payload in Doc
seems irrelevant when you aren't rendering to HTML.