Re: Creating adoc files dynamically with blocks
Posted by
David Jencks on
URL: https://discuss.asciidoctor.org/Creating-adoc-files-dynamically-with-blocks-tp8165p8166.html
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.
David Jencks
On Aug 13, 2020, at 7:12 AM, guidog [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
Hi,
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
Thanks
guido