A caption to an image is provided in ASCIIDoctor document as follows:
.This is a caption
However, the caption is aligned to the left by default.
Applying a text-center on it does not work:
.This is a caption
This problem has been discussed in this Github issue. The solution provided to add a few lines to imageblock in the stylesheet does not work. Instead, I changed the default behavior itself in the stylesheet to be center.
To do this first find out where gems are installed:
$ gem environment
Go to the INSTALLATION DIRECTORY output in the above command and to the subdirectory holds ASCIIDoctor stylesheets:
$ cd gems/asciidoctor-1.5.2/data/stylesheets/
Open the asciidoctor-default.css and find the place where for imageblock the text-align attribute is set to left and change that to center. For me, this was in line 177.
Rebuild your ASCIIDoctor document and the rendered HTML should have centered image caption.
Tried with: ASCIIDoctor 1.5.2, Ruby 2.1.0 and Ubuntu 14.04
The LivePage extension for Chrome is useful if you want to view a HTML page or file and want it to be refreshed as soon as it is updated. This can be useful if you are editing or producing the HTML file. For example, I use it to view the HTML file produced by compiling a ASCIIDoc or ASCIIDoctor file.
Open the local or internet webpage and click the LivePage icon. The page will be refreshed as soon as it is changed.
Note: If you want to refresh local HTML files, head to Chrome Extensions section, scroll down to LivePage and enable the Allow access to file URLs checkbox.
Tried with: LivePage 1.5.2, Chrome 40.0.2214.115 (64-bit) and Ubuntu 14.04
Adding source code to ASCIIDoc documents is easy, as described here. ASCIIDoctor can be used to easily convert them to HTML5 documents using the html5 backend (which is the default). However, the source code is not rendered with syntax highlighting.