forked from asciidoctor/asciidoctor
-
Notifications
You must be signed in to change notification settings - Fork 0
Enabling the caption for a block with no title
Dan Allen edited this page May 24, 2013
·
1 revision
AsciiDoc (and the DocBook toolchain) only adds a caption (e.g., Example 1) to a block when the block has a title.
There are a few approaches to getting the caption without a title.
You can trick AsciiDoc/DocBook into thinking the block has a title using the zero-width space character (which is aliased to the zwsp
attribute).
.{zwsp} ==== example block content ====
This should appear as:
Example 1.
example block content
.{example-caption} {counter:example-number}. ==== example block content ====
This should also appear as:
Example 1.
example block content
The final option is to customize the template in the backend so that it always uses the caption even in the absence of a title.
These workarounds are necessary because you are working around the convention that a caption (e.g., Example 1) should only be used in the case when the block has a title.