Hi,
I finalize my idea about using asciidoc for content storage and make an extension to asciidoctorJ to support some more structure way of getting asciidoc file into java object.
For now it works great. It supports retrieving content parts by id, title, style, role, attributes and context so you can for example write:
List<ContentPart> images = document.getPartsByContext("image");
to get a list of images defined in the document and then to process single image:
String src = (String) image.getAttributes().get("target");
String alt = (String) image.getAttributes().get("alt");
String link = (String) image.getAttributes().get("link");
or other use case:
String text =document.getPartByStyle("description").getContent();
to get actual text of the block annotated with [description] style.
I like that idea there much and now it is really convenient to process your asciidocument to actual flexible content.
I would love to have it in the mainstream of asciidoctorJ so please review my branch:
https://github.com/smigielski/asciidoctor-java-integration/tree/structureddocumentsIf it is ok for you I will issue a pull request.
Cheers,
Marek