You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: json-rpc-settings.md
+34-3
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ You might need to have some settings in your plugins that are easily changeable
4
4
5
5
6
6
### SettingsTemplate.yaml
7
-
This is a YAML files that contains the settings page layout for your plugin. It contains an object with a single property called `body`. The `body` property contains an array of objects that define the layout of the settings page. Each object in the `body` array is a section of the settings page. Each section takes up the entire width of the page, which means you can't have one input on the left and one on the right. The layout of each section is always static: input description on the left, input on the right. Every object in the `body` array has the same structure: a `type` property that defines the type of this input (text input, textarea etc.), and an `attributes` property that contains everything else the object needs to render, such as label, description, or default value. The following is a list of the different types of inputs that can be used in the `SettingsTemplate.yaml` file.
7
+
This is a YAML file that contains the settings page layout for your plugin. It contains an object with a single property called `body`. The `body` property contains an array of objects that define the layout of the settings page. Each object in the `body` array is a section of the settings page. Each section takes up the entire width of the page, which means you can't have one input on the left and one on the right. The layout of each section is always static: input description on the left, input on the right. Every object in the `body` array has the same structure: a `type` property that defines the type of this input (text input, textarea etc.), and an `attributes` property that contains everything else the object needs to render, such as label, description, or default value. The following is a list of the different input types that can be used in the `SettingsTemplate.yaml` file.
8
8
9
9
---
10
10
@@ -15,6 +15,8 @@ type: textBlock
15
15
attributes:
16
16
description: This is a block of text.
17
17
```
18
+
<settings-component-demo type="textBlock" description="This is a block of text."></settings-component-demo>
19
+
18
20
| Property name | Property description |
19
21
|---------------|----------------------|
20
22
| `description` | The text to display. |
@@ -29,6 +31,8 @@ attributes:
29
31
description: Description of the input
30
32
defaultValue: Hello there
31
33
```
34
+
<settings-component-demo type="input" label="This is a text input" description="Description of the input" value="Hello there"></settings-component-demo>
| `name` | The name of the input. This is the key that you will use to access the value of the input in the settings object. |
@@ -46,6 +50,8 @@ attributes:
46
50
description: Description of the input
47
51
defaultValue: Hello there
48
52
```
53
+
<settings-component-demo type="inputWithFileBtn" label="This is a text input with a Browse button" description="Description of the input" value="Hello there"></settings-component-demo>
| `name` | The name of the input. This is the key that you will use to access the value of the input in the settings object. |
@@ -64,6 +70,8 @@ attributes:
64
70
description: Description of the input
65
71
defaultValue: Hello there
66
72
```
73
+
<settings-component-demo type="textarea" label="This is a multiline text input" description="Description of the input" value="Hello there"></settings-component-demo>
| `name` | The name of the input. This is the key that you will use to access the value of the input in the settings object. |
@@ -81,6 +89,8 @@ attributes:
81
89
description: Description of the input
82
90
defaultValue: secret password
83
91
```
92
+
<settings-component-demo type="passwordBox" label="This is a password input" description="Description of the input" value="secret password"></settings-component-demo>
| `name` | The name of the input. This is the key that you will use to access the value of the input in the settings object. |
@@ -102,6 +112,8 @@ attributes:
102
112
- Option 2
103
113
- Option 3
104
114
```
115
+
<settings-component-demo type="dropdown" label="This is a dropdown input" description="Description of the input" value="Option 1" options='["Option 1", "Option 2", "Option 3"]'></settings-component-demo>
| `name` | The name of the checkbox. This is the key that you will use to access the value of the checkbox in the settings object. |
@@ -158,10 +172,27 @@ body:
158
172
- "C#"
159
173
- type: checkbox
160
174
attributes:
161
-
name: Prefer shorter answers
175
+
name: preferShorterAnswers
176
+
label: Prefer shorter answers
162
177
description: If checked, the plugin will try to give answer much shorter than the usual ones.
163
178
defaultValue: false
164
179
```
180
+
<settings-component-demo type="textBlock" description="Welcome to the settings page for my plugin. Here you can configure the plugin to your liking."></settings-component-demo>
181
+
<settings-component-demo type="input" label="How should I call you?" value="the user"></settings-component-demo>
182
+
<settings-component-demo type="textarea" label="Text to prepend to result output" description='This text will be added to the beginning of the result output. For example, if you set this to "The result is: ", and the result is "42", the output will be "The result is: 42".'></settings-component-demo>
183
+
<settings-component-demo type="dropdown" label="Programming language to prefer for answers" value="TypeScript" options='["JavaScript", "TypeScript", "Python", "C#"]'></settings-component-demo>
184
+
<settings-component-demo type="checkbox" label="Prefer shorter answers" description="If checked, the plugin will try to give answer much shorter than the usual ones."></settings-component-demo>
165
185
166
186
### Visual editor for `SettingsTemplate.yaml`
167
-
You can use a [visual editor](https://flow-launcher-plugin-settings-generator.pages.dev/) for creating the `SettingsTemplate.yaml` file. When you're done editing, click the `Generate SettingsTemplate.yaml` file and copy-paste its contents into your `SettingsTemplate.yaml` file. Optionally, you can also copy the generated typings for your settings object in your preferred programming language.
187
+
You can use a [visual editor](#/json-rpc-visual-settingstemplate-editor) for creating the `SettingsTemplate.yaml` file. When you're done editing, click the `Generate SettingsTemplate.yaml` file and copy-paste its contents into your `SettingsTemplate.yaml` file. Optionally, you can also copy the generated typings for your settings object in your preferred programming language.
188
+
189
+
<script>
190
+
const element = document.querySelector('#__settings-script__');
Note that data in the editor below is not persisted. It will be lost once you close your browser. Remember to press "Generate SettingsTemplate.yaml" and save the result if you want to keep it.
4
+
5
+
If you already have a SettingsTemplate.yaml file and would like to try editing it here, just copy its contents and paste it on this page.
0 commit comments