diff --git a/backend/src/plugins/Tags/TagsPlugin.ts b/backend/src/plugins/Tags/TagsPlugin.ts index 084a0e3a..7ed3e233 100644 --- a/backend/src/plugins/Tags/TagsPlugin.ts +++ b/backend/src/plugins/Tags/TagsPlugin.ts @@ -69,7 +69,6 @@ export const TagsPlugin = zeppelinGuildPlugin()({ 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. - ### Available Functions Here are the functions you can use in your tags: ${generateTemplateMarkdown(TemplateFunctions)} diff --git a/backend/src/plugins/Tags/docs.ts b/backend/src/plugins/Tags/docs.ts index 6fcf6a28..01f27922 100644 --- a/backend/src/plugins/Tags/docs.ts +++ b/backend/src/plugins/Tags/docs.ts @@ -1,11 +1,17 @@ +import { trimPluginDescription } from "src/utils"; import { TemplateFunction } from "./types"; export function generateTemplateMarkdown(definitions: TemplateFunction[]): string { return definitions .map(def => { const usage = def.signature ?? `(${def.arguments.join(", ")})`; - const exampl = def.examples ? def.examples.map(ex => `> ${ex}`).join("\n") : ""; - return `#### ${def.name}\n\`{${def.name}${usage}}\`\n**${def.description}**\n${exampl}`; + const exampl = def.examples ? def.examples.map(ex => `> \`{${ex}}\``).join("\n") : null; + return trimPluginDescription(` + ## ${def.name} + **${def.description}**\n + __Usage__: \`{${def.name}${usage}}\`\n + ${exampl ? `__Examples__:\n${exampl}` : ""}\n\n + `); }) .join("\n\n"); }