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 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 values

Supported values for script are:

  • 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.