Re: asciidoctor-maven-plugin and images.
Posted by
abelsromero on
Jan 25, 2015; 9:10pm
URL: https://discuss.asciidoctor.org/asciidoctor-maven-plugin-and-images-tp2695p2706.html
With your example I see what's the problem now, this also reminds me of another issue we have and which has been in my head some days.
Currently there's no way to deal with those complex scenarios other than manually copying files from folder to folder. In which case I'd recommend (if possible) to change your built to gradle. It is much easier to customized the build with gradle's copy tasks. Also in gradle, it would be possible to add your image copy code in the build script itself.
Another option, more risky and not available in maven now (see
https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/146), you could write an extension to do the copying while processing, that way you avoid parsing the HTML, and only used images are copied. This implies using the build in gradle or waiting till the issue is solved, I hope I can do something this week, but I cannot say when this will be released.
pros:
+You can make the conversion fail if an image is not found
cons:
-You create a new macro which converts means you'r not using standard AsciiDoc
Btw, I think a good approach could be an inline macro, check
http://asciidoctor.org/docs/asciidoctorj/A bit off-topic, but I think that it would be great if asciidoctor was able to get resources from the classpath, which currently can't. That way it would be possible to pack common resources in distributable jars like your 'modules' and 'images' folders.
I'm asking this to the rest of the team, could this be done in Asciidoctorj? Maybe creating a temp folder where all resources are unpacked?