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

PropertyDescriptionValuesMandatory
typescriptstringYes
valueLanguage type used for syntax highlighting. See supported value values.stringYes
attributeTypeKeyKey of the attribute that contains the text whose syntax will be highlighted in the selected language.stringYes
componentIdUnique 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).stringNo

Supported value values

Supported values for script are:

ValueDescription
csharpFormats the text as C# script.
cssFormats the text as CSS script.
cypherFormats the text as Cypher script.
graphqlFormats the text as GraphQL script.
htmlFormats the text as HTML code.
javascriptFormats the text as JavaScript script.
jsonFormats the text as JSON code.
kotlinFormats the text as Kotlin script.
n1qlFormats the text as N1QL script.
pgsqlFormats the text as PgSQL script.
phpFormats the text as PHP script.
postgresqlFormats the text as PostgreSQL script.
pythonFormats the text as Python code.
scalaFormats the text as Scala script.
sqlFormats the text as SQL script.
tsqlFormats the text as T-SQL script.
typescriptFormats the text as TypeScript script.
xmlFormats the text as XML script.
yamlFormats the text as YAML script.