Skip to content

Commit 4e5f9ae

Browse files
Document multiline help text for app settings (#228)
## 💸 TL;DR <!-- What's the three sentence summary of purpose of the PR --> I ran an audit of what was missing from our changelog in our docs and had codex run a first pass. Shows how to add multiline instructions beneath app settings.
1 parent c5877cf commit 4e5f9ae

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

‎docs/capabilities/server/settings-and-secrets.mdx‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,29 @@ Define settings in your `devvit.json` file under the `settings` object. Settings
7979
After defining settings in `devvit.json`, you must build your app (`npm run dev`) before you can set secrets via the CLI.
8080
:::
8181

82+
### Help text
83+
84+
Add optional `helpText` to explain a setting. In the installation settings UI, line breaks are preserved. Use `\n` for a new line and `\n\n` for a blank line in JSON:
85+
86+
```json title="devvit.json"
87+
{
88+
"settings": {
89+
"subreddit": {
90+
"welcomeMessage": {
91+
"type": "string",
92+
"label": "Welcome Message",
93+
"defaultValue": "Welcome to the community!",
94+
"helpText": "Shown to new members.\nKeep the message short.\n\nDo not include private information."
95+
}
96+
}
97+
}
98+
}
99+
```
100+
101+
Help text is plain text. Use line breaks to separate instructions, and avoid relying on HTML, Markdown, or repeated spaces for formatting. Omit `helpText` or use an empty string to display no help text.
102+
103+
Individual global and subreddit settings support `helpText`. The example above shows its presentation in installation settings. Help text provides guidance; use `defaultValue` to set an initial value and `validationEndpoint` to validate input.
104+
82105
## Setting types
83106

84107
The following setting types are supported:

‎versioned_docs/version-0.14/capabilities/server/settings-and-secrets.mdx‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,29 @@ Define settings in your `devvit.json` file under the `settings` object. Settings
7979
After defining settings in `devvit.json`, you must build your app (`npm run dev`) before you can set secrets via the CLI.
8080
:::
8181

82+
### Help text
83+
84+
Add optional `helpText` to explain a setting. In the installation settings UI, line breaks are preserved. Use `\n` for a new line and `\n\n` for a blank line in JSON:
85+
86+
```json title="devvit.json"
87+
{
88+
"settings": {
89+
"subreddit": {
90+
"welcomeMessage": {
91+
"type": "string",
92+
"label": "Welcome Message",
93+
"defaultValue": "Welcome to the community!",
94+
"helpText": "Shown to new members.\nKeep the message short.\n\nDo not include private information."
95+
}
96+
}
97+
}
98+
}
99+
```
100+
101+
Help text is plain text. Use line breaks to separate instructions, and avoid relying on HTML, Markdown, or repeated spaces for formatting. Omit `helpText` or use an empty string to display no help text.
102+
103+
Individual global and subreddit settings support `helpText`. The example above shows its presentation in installation settings. Help text provides guidance; use `defaultValue` to set an initial value and `validationEndpoint` to validate input.
104+
82105
## Setting types
83106

84107
The following setting types are supported:

0 commit comments

Comments
 (0)