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#
└── Snippet
└── params
└── *
├── Content Parser Configuration
│ └── options
│ └── Snippet Style
├── Key Value List Parser Configuration
│ └── options
│ └── Snippet Style
├── Repeating Parser Configuration
│ └── options
│ └── Snippet Style
└── Wrapper Parser Configuration
└── options
└── Snippet StyleType#
Object
Properties#
Appears in: Snippet Style.
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.
Show examplesHide 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": " "
}
}
}
}
}
}
}
}This key defines inline formatting options for snippet output.
The value is an object that can contain leading and trailing properties. These options control whitespace for single-line snippet content.
Appears in: Snippet Style.
Show examplesHide examples
In this example, we have configured inline formatting with leading and trailing spaces.
_snippets:
highlight:
snippet: <<highlight>> [[content]] <</highlight>>
params:
content:
parser: content
options:
style:
inline:
leading: ' '
trailing: ' '{
"_snippets": {
"highlight": {
"snippet": "<<highlight>> [[content]] <</highlight>>",
"params": {
"content": {
"parser": "content",
"options": {
"style": {
"inline": {
"leading": " ",
"trailing": " "
}
}
}
}
}
}
}
}This key defines the output format style for snippet content.
The value can be legacy, inline, or block. This controls how snippet content is formatted when output to source code.
Allowed values: legacy inline block
Appears in: Snippet Style.
Show examplesHide examples
In this example, we have configured snippet output style to use block formatting.
_snippets:
highlight:
snippet: <<highlight>> [[content]] <</highlight>>
params:
content:
parser: content
options:
style:
output: block{
"_snippets": {
"highlight": {
"snippet": "<<highlight>> [[content]] <</highlight>>",
"params": {
"content": {
"parser": "content",
"options": {
"style": {
"output": "block"
}
}
}
}
}
}
}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": " "
}
}
}
}
}
}
}
}