typelevel / Laika

Site and E-book Generator and Customizable Text Markup Transformer for sbt, Scala and Scala.js
https://typelevel.org/Laika/
Apache License 2.0
406 stars 44 forks source link

Render as reStructuredText #12

Open sbrunk opened 10 years ago

sbrunk commented 10 years ago

Is it possible to write a Document Tree Model back to reStructuredText somehow? Could it even be possible to do it "lossless", that is, recreate the exact original document from the tree model? Use case would be an editor that changes a few elements programmatically but stores back reStructuredText.

jenshalm commented 10 years ago

Writing back in markup format is currently not possible. I had it on the back of my mind, but it's not on the road map yet. But when I thought of it I was thinking more about cross-transforming from one format to the other. Making it lossless is not trivial, the current model would not be sufficient as each node would need to store the original input string. The current model only does that for a few selected node types like link references where it is quite common to write back the source to the target format when they cannot be resolved.