Skip to content

Commit

Permalink
docs: add code widget docs (#3023)
Browse files Browse the repository at this point in the history
  • Loading branch information
erquhart committed Jan 4, 2020
1 parent 1b755b3 commit e262e88
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions website/content/docs/widgets/code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: code
label: 'Code'
---

The code widget provides a code editor (powered by [Codemirror](https://codemirror.net)) with optional syntax awareness. Can output the raw code value or an object with the selected language and the raw code value.

- **Name:** `code`
- **UI:** code editor
- **Data type:** string
- **Options:**
- `default_language`: optional; default language to use
- `allow_language_selection`: optional; defaults to `false`: allows syntax to be changed
- `keys`: optional; sets key names for code and lang if outputting an object; defaults to `{ code: 'code', lang: 'lang' }`
- `output_code_only`: set to `true` to output the string value only, defaults to `false`

- **Example:**
```yaml
- label: 'Code'
name: 'code'
widget: 'code'
```

0 comments on commit e262e88

Please sign in to comment.