Description#
The snippet shortcode allows to write a code fragment, defined either from the shortcode content , or from a template file.
Moreover, it is possible to define snippets organised in tabs. To do so, nest as many tab shortcode as needed in a parent snippet shortcode.
For example: display CLI commands depending on the operating system used.
Parameters#
Name | Type(named/positional) | Description |
---|---|---|
file | named | File path to include. NB: The file parameter takes precedence over the content of the shortcode. |
type | named | File format to include.
NB: If not specified, the default type is code. |
caption | named | Code snippet caption. NB: Parameter only applicable for a snippet of code type. |
codelang | named | Code snippet language. NB: Parameter only applicable for a snippet of code type. |
codeparam | named | Code snippet highlight settings
. NB: Parameter only applicable for a snippet of code type. |
title | named | Tab title. NB: Parameter only applicable for a tab shortcode nested in a snippet shortcode. |
Examples#
Markdown | Rendering | ||
---|---|---|---|
|
| ||
|
| ||
| |||
| # Hello, World!
---
*I am* **a reusable** ***template*** to include in a page content. | ||
|
| ||
| |||
| # Hello, World!
---
*I am* **a reusable** ***template*** to include in a page content. | ||
|
| ||
|
# Hello, World!
---
*I am* **a reusable** ***template*** to include in a page content. | ||
|
# Hello, World!
---
*I am* **a reusable** ***template*** to include in a page content. |