code
The code widget provides a code editor (powered by Codemirror) with optional syntax awareness. Can output the raw code value or an object with the selected language and the raw code value.
Name:
codeUI: code editor
Data type: string
Options:
required: specify asfalseto make a field optional; defaults totruedefault_language: optional; default language to useallow_language_selection: optional; defaults tofalse: allows syntax to be changedkeys: optional; sets key names for code and lang if outputting an object; defaults to{ code: 'code', lang: 'lang' }output_code_only: set totrueto output the string value only, defaults tofalse
Example:
- label: 'Code' name: 'code' widget: 'code'