This key defines block-level formatting options for snippet output.
The value is an object that can contain leading, trailing, and indent properties. These options control whitespace and indentation for multi-line snippet content.
Appears in#
└── Snippet Style
└── blockType#
Object
Properties#
This key defines the indentation string used for block-level snippet content.
The value is a string that specifies the indentation tokens (typically spaces or tabs) applied to each line of block-level snippet content.
Appears in: Snippet Style block.
Show examplesHide examples
In this example, we have configured block indentation to use two spaces.
_snippets:
highlight:
snippet: <<highlight>> [[content]] <</highlight>>
params:
content:
parser: content
options:
style:
block:
indent: ' '{
"_snippets": {
"highlight": {
"snippet": "<<highlight>> [[content]] <</highlight>>",
"params": {
"content": {
"parser": "content",
"options": {
"style": {
"block": {
"indent": " "
}
}
}
}
}
}
}
}This key defines the leading whitespace string for block-level snippet content.
The value is a string that specifies whitespace tokens (typically newlines) inserted before block-level snippet content.
Appears in: Snippet Style block.
Show examplesHide examples
In this example, we have configured block leading whitespace to use a newline.
_snippets:
highlight:
snippet: <<highlight>> [[content]] <</highlight>>
params:
content:
parser: content
options:
style:
block:
leading: \n{
"_snippets": {
"highlight": {
"snippet": "<<highlight>> [[content]] <</highlight>>",
"params": {
"content": {
"parser": "content",
"options": {
"style": {
"block": {
"leading": "\\n"
}
}
}
}
}
}
}
}This key defines the trailing whitespace string for block-level snippet content.
The value is a string that specifies whitespace tokens (typically newlines) inserted after block-level snippet content.
Appears in: Snippet Style block.
Show examplesHide examples
In this example, we have configured block trailing whitespace to use a newline.
_snippets:
highlight:
snippet: <<highlight>> [[content]] <</highlight>>
params:
content:
parser: content
options:
style:
block:
trailing: \n{
"_snippets": {
"highlight": {
"snippet": "<<highlight>> [[content]] <</highlight>>",
"params": {
"content": {
"parser": "content",
"options": {
"style": {
"block": {
"trailing": "\\n"
}
}
}
}
}
}
}
}Examples#
In this example, we have configured block formatting with leading, trailing, and indent options.
_snippets:
highlight:
snippet: <<highlight>> [[content]] <</highlight>>
params:
content:
parser: content
options:
style:
block:
leading: \n
trailing: \n
indent: ' '{
"_snippets": {
"highlight": {
"snippet": "<<highlight>> [[content]] <</highlight>>",
"params": {
"content": {
"parser": "content",
"options": {
"style": {
"block": {
"leading": "\\n",
"trailing": "\\n",
"indent": " "
}
}
}
}
}
}
}
}