Asciidoc-DSL seeks to overcome this problem by allowing users to generate natural object graphs representing the document structure they wish to produce. Asciidoc-DSL then renders the document in a format that can be used as an input to AsciidoctorJ to produce the desired output.
Document document = new Document();
document.add(AsciidocBuilder.paragraph(AsciidocBuilder.big("Hello Asciidoc-DSL!")));
document.add(AsciidocBuilder.horizontalRule());
document.add(ListBuilder.buildListBuilder(ListType.UNORDERED).addItem("Item 1").addItem("Item 2").buildList());
StringBuilder stringBuilder = new StringBuilder();
document.render(stringBuilder);