Component description
The script component automatically formats and syntax-highlights code snippets (e.g., SQL, JSON, JavaScript), making them clearer, easier to read, and more consistent for users working with technical content.
Example
Minimal JSON
{
"type": "script",
"value": "",
"attributeTypeKey": ""
}{
"type": "script",
"value": "python",
"attributeTypeKey": "python"
}Nested properties
| Property | Description | Values | Mandatory |
|---|---|---|---|
type | script | string | Yes |
value | Language type used for syntax highlighting. See supported value values. | string | Yes |
attributeTypeKey | Key of the attribute that contains the text whose syntax will be highlighted in the selected language. | string | Yes |
componentId | Unique ID of a component. If left empty, a random string will be generated. Primarily used in patch packages to define the component’s position within the layout (template). | string | No |
Supported value values
Supported values for script are:
| Value | Description |
|---|---|
csharp | Formats the text as C# script. |
css | Formats the text as CSS script. |
cypher | Formats the text as Cypher script. |
graphql | Formats the text as GraphQL script. |
html | Formats the text as HTML code. |
javascript | Formats the text as JavaScript script. |
json | Formats the text as JSON code. |
kotlin | Formats the text as Kotlin script. |
n1ql | Formats the text as N1QL script. |
pgsql | Formats the text as PgSQL script. |
php | Formats the text as PHP script. |
postgresql | Formats the text as PostgreSQL script. |
python | Formats the text as Python code. |
scala | Formats the text as Scala script. |
sql | Formats the text as SQL script. |
tsql | Formats the text as T-SQL script. |
typescript | Formats the text as TypeScript script. |
xml | Formats the text as XML script. |
yaml | Formats the text as YAML script. |