Skip to content

Commit

Permalink
Improve appearance of render help
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfbacon committed Feb 7, 2025
1 parent 9c25d7d commit 8ae13dc
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions crates/bot/src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,26 +197,21 @@ fn render_help() -> String {

format!(
"\
Render the given code as an image.
Render Typst code as an image.
Syntax: `?render [pagesize=<page size>] [theme=<theme>] <code block> [...]`
**Flags**
- `pagesize` can be `preview` (default), `auto`, or `default`.
- `theme` can be `dark` (default), `light`, or `transparent`.
To be clear, the full default preamble is:
```
{default_preamble}
```
To remove the preamble entirely, use `pagesize=default theme=transparent`.
**Examples**
```
?render `hello, world!`
Expand Down Expand Up @@ -288,7 +283,6 @@ impl<'a> poise::PopArgument<'a> for Rest {
}
}

/// Render Typst code as an image.
#[poise::command(
prefix_command,
track_edits,
Expand All @@ -299,11 +293,9 @@ impl<'a> poise::PopArgument<'a> for Rest {
)]
async fn render(
ctx: Context<'_>,
#[description = "Flags"] flags: RenderFlags,
#[description = "Code to render"] code: CodeBlock,
#[rename = "rest"]
#[description = "Extra message content"]
_: Rest,
flags: RenderFlags,
code: CodeBlock,
#[rename = "rest"] _: Rest,
) -> Result<(), PoiseError> {
let pool = &ctx.data().pool;

Expand Down

0 comments on commit 8ae13dc

Please sign in to comment.