Parses the given raw asciidoctor content, parses it and appends it as children to the given parent block.
The following example will add two paragraphs with the role
newcontent to all top
level sections of a document:
Asciidoctor asciidoctor = ...
asciidoctor.javaExtensionRegistry().treeprocessor(new Treeprocessor() {
DocumentRuby process(DocumentRuby document) {
for (AbstractBlock block: document.getBlocks()) {
if (block instanceof Section) {
parseContent(block, Arrays.asList(new String[]{
"[newcontent]",
"This is new content"
"",
"[newcontent]",
"This is also new content"}));
}
}
}
});