mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 09:35:02 +00:00
fix
This commit is contained in:
parent
43e42ba7c7
commit
45c16ea48f
2 changed files with 8 additions and 3 deletions
|
@ -69,7 +69,6 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
|
||||||
You can use these functions to render dynamic content, or to access information from the message and/or user calling the tag.
|
You can use these functions to render dynamic content, or to access information from the message and/or user calling the tag.
|
||||||
You use them by adding a \`{}\` on your tag.
|
You use them by adding a \`{}\` on your tag.
|
||||||
|
|
||||||
### Available Functions
|
|
||||||
Here are the functions you can use in your tags:
|
Here are the functions you can use in your tags:
|
||||||
|
|
||||||
${generateTemplateMarkdown(TemplateFunctions)}
|
${generateTemplateMarkdown(TemplateFunctions)}
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
|
import { trimPluginDescription } from "src/utils";
|
||||||
import { TemplateFunction } from "./types";
|
import { TemplateFunction } from "./types";
|
||||||
|
|
||||||
export function generateTemplateMarkdown(definitions: TemplateFunction[]): string {
|
export function generateTemplateMarkdown(definitions: TemplateFunction[]): string {
|
||||||
return definitions
|
return definitions
|
||||||
.map(def => {
|
.map(def => {
|
||||||
const usage = def.signature ?? `(${def.arguments.join(", ")})`;
|
const usage = def.signature ?? `(${def.arguments.join(", ")})`;
|
||||||
const exampl = def.examples ? def.examples.map(ex => `> ${ex}`).join("\n") : "";
|
const exampl = def.examples ? def.examples.map(ex => `> \`{${ex}}\``).join("\n") : null;
|
||||||
return `#### ${def.name}\n\`{${def.name}${usage}}\`\n**${def.description}**\n${exampl}`;
|
return trimPluginDescription(`
|
||||||
|
## ${def.name}
|
||||||
|
**${def.description}**\n
|
||||||
|
__Usage__: \`{${def.name}${usage}}\`\n
|
||||||
|
${exampl ? `__Examples__:\n${exampl}` : ""}\n\n
|
||||||
|
`);
|
||||||
})
|
})
|
||||||
.join("\n\n");
|
.join("\n\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue