I don’t think there’s an actual converter that can be used with asciidoctor that can do this.
It’s possible that asciidoctor-kramdown has something similar, as it emits asciidoc.
One difficulty with this is that it’s easy to create block trees that can render fine to html but that cannot be created from an asciidoc document.
For instance, it’s possible to have the blocks in a section be paragraph, section, paragraph, but when parsing asciidoc all the subsections have to be at the end of the blocks, with no paragraph blocks following.
On Aug 13, 2020, at 7:12 AM, guidog [via Asciidoctor :: Discussion] <[hidden email]
I want to create a new adoc file dynamically using this blocks
doc = Asciidoctor::Document.new
doc << block1
doc << block2
If I do that, is it possible to write the source content to a new adoc file?
I don't want to convert it at this point, I just want to read an adoc file and generate a new file with some modifications.
It is like a converter to Asciidoc itself or a pretty printer for Asciidoctor::Document