asciidocasciidoctor

Is it possible to position image title/caption above the image in Asciidoctor


Currently, all image caption I have used are automatically placed before an image, despite me placing the caption before the image in the code.

For example,

[caption=]
.Simple diagram of data storage
image::user-guide/data-storage.png[width="600"]

Is there any way I can re-position the caption such that it appears above/before the image like how table titles are positioned above a table?


Solution

  • I assume you're using the standard HTML5 output of Asciidoctor. This can't be parameterized; the HTML will always render first the image and then the title element.

    You could override the rendering of images in the HTML5 backend, or create your own backend to structure the output as you need.