Source Code Snippets and Examples

Examples are non-AsciiDoc files that contain reusable content, such as source code or data values, that are often inserted into source, listing, and literal blocks. Examples are saved in the examples directory.

Reusable, single source examples

Examples are good for storing source code, queries, configuration parameters, terminal output, logs, data sets, and other non-AsciiDoc files, that you reuse in one or more pages throughout your site. When you change the content in an example, those changes will disseminate to all of the pages where you embedded that example with an AsciiDoc include directive. Specific regions or lines from an example can also be inserted in a page using the include directive’s tag, tags, or lines attributes.

Examples shouldn’t be confused with the AsciiDoc example block, though they can be inserted into an example block using an include directive.