This key defines configuration options for wrapper parser configurations.
The value is an object that can contain snippet and remove_empty properties. These options control which snippet configuration is wrapped and whether empty values are removed.
Appears in#
└── Snippet
└── params
└── *
└── Wrapper Parser Configuration
└── optionsType#
Object Required
Properties#
This key toggles whether CloudCannon will remove empty values from wrapper parser configurations.
Setting this key to true will remove empty values from the wrapped snippet configuration.
By default, this key is false (i.e., empty values are not removed).
Appears in: Wrapper Parser Configuration options.
Show examplesHide examples
In this example, we have configured wrapper parser to remove empty values.
_snippets:
example:
snippet: <<example [[wrapped_content]]>>
params:
wrapped_content:
parser: wrapper
options:
snippet: content
remove_empty: true{
"_snippets": {
"example": {
"snippet": "<<example [[wrapped_content]]>>",
"params": {
"wrapped_content": {
"parser": "wrapper",
"options": {
"snippet": "content",
"remove_empty": true
}
}
}
}
}
}This key defines the snippet configuration to wrap for wrapper parser configurations.
The value is a string that specifies the key name of another snippet configuration defined in _snippets. This snippet configuration will be wrapped by the wrapper parser.
Appears in: Wrapper Parser Configuration options.
Show examplesHide examples
In this example, we have configured a snippet reference for wrapper parser.
_snippets:
example:
snippet: <<example [[wrapped_content]]>>
params:
wrapped_content:
parser: wrapper
options:
snippet: content
content:
snippet: <<content [[text]]>>
params:
text:
parser: content
options:
editor_key: content_text{
"_snippets": {
"example": {
"snippet": "<<example [[wrapped_content]]>>",
"params": {
"wrapped_content": {
"parser": "wrapper",
"options": {
"snippet": "content"
}
}
}
},
"content": {
"snippet": "<<content [[text]]>>",
"params": {
"text": {
"parser": "content",
"options": {
"editor_key": "content_text"
}
}
}
}
}
}This key defines styling options for snippet output formatting.
The value is an object that can contain output, inline, and block properties. These options control how snippet content is parsed and formatted to produce cleaner source code.
Appears in: Content Parser Configuration options, Key Value List Parser Configuration options, Repeating Parser Configuration options, Wrapper Parser Configuration options.
Show examplesHide examples
In this example, we have configured snippet style with inline and block formatting options.
_snippets:
highlight:
snippet: <<highlight>> [[content]] <</highlight>>
params:
content:
parser: content
options:
style:
inline:
leading: ' '
trailing: ' '
block:
leading: \n
trailing: \n
indent: ' '{
"_snippets": {
"highlight": {
"snippet": "<<highlight>> [[content]] <</highlight>>",
"params": {
"content": {
"parser": "content",
"options": {
"style": {
"inline": {
"leading": " ",
"trailing": " "
},
"block": {
"leading": "\\n",
"trailing": "\\n",
"indent": " "
}
}
}
}
}
}
}
}Examples#
In this example, we have configured wrapper parser options with a snippet reference.
_snippets:
example:
snippet: <<example [[wrapped_content]]>>
params:
wrapped_content:
parser: wrapper
options:
snippet: content{
"_snippets": {
"example": {
"snippet": "<<example [[wrapped_content]]>>",
"params": {
"wrapped_content": {
"parser": "wrapper",
"options": {
"snippet": "content"
}
}
}
}
}
}