Example Blocks

On this page, you’ll learn:

  • How to mark up an example block with AsciiDoc.

An example block is useful for visually delineating content that illustrates a concept or showing the result of an operation.

An example can contain any type of content and AsciiDoc syntax. Normal substitutions are applied to example content.

Example style syntax

If the example content is contiguous, i.e., not interrupted by empty lines, the block style name example can be placed directly on top of the text in an attribute list ([]).

Example 1. Assign example block style to paragraph
.Optional title
[example]
This is an example of an example block.

The result of Example 1 is displayed below.

Optional title
This is an example of an example block.

Delimited example syntax

If the example content includes multiple blocks or content separated by empty lines, place the content between delimiter lines consisting of four equals signs (====).

You don’t need to set the block style name when you use the example delimiters.

Example 2. Example block delimiter syntax
.Onomatopoeia
====
The book hit the floor with a *thud*.

He could hear doves *cooing* in the pine trees`' branches.
====

The result of Example 2 is displayed below.

Onomatopoeia

The book hit the floor with a thud.

He could hear doves cooing in the pine trees’ branches.

Complex admonitions use the delimited example syntax.