Skip to content

Commit 2c4e392

Browse files
authored
Merge pull request #42 from isuffix/render-flags-help
Improve help for `?render` flags and aliases
2 parents f2e8659 + da37393 commit 2c4e392

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

crates/bot/src/bot.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,19 @@ fn render_help() -> String {
199199
"\
200200
Render Typst code as an image.
201201
202-
Syntax: `?render [pagesize=<page size>] [theme=<theme>] <code block> [...]`
202+
Render command syntax:
203+
- `?render [pagesize=<page size>] [theme=<theme>] <code block> [...]`
204+
- Aliases: `?r ps={{p,a,d}} t={{d,l,t}} <code block> [...]`
203205
204206
**Flags**
205-
- `pagesize` can be `preview` (default), `auto`, or `default`.
206-
- `theme` can be `dark` (default), `light`, or `transparent`.
207+
- **`pagesize=`** (alias: **`ps=`**):
208+
- `preview` (alias `p`, default): 10pt margin, 300pt width, auto height
209+
- `auto` (alias `a`): 10pt margin, auto width, auto height
210+
- `default` (alias `d`): Leave as Typst's default
211+
- **`theme=`** (alias **`t=`**):
212+
- `dark` (alias `d`, default): Set text and background to match Discord's dark theme
213+
- `light` (alias `l`): Set the background to white
214+
- `transparent` (alias `t`): Leave the background transparent
207215
208216
To be clear, the full default preamble is:
209217
```
@@ -215,6 +223,8 @@ To remove the preamble entirely, use `pagesize=default theme=transparent`.
215223
```
216224
?render `hello, world!`
217225
226+
?r ps=a t=l `Short syntax!`
227+
218228
?render pagesize=default theme=light ``‍`
219229
= Heading!
220230

0 commit comments

Comments
 (0)