3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-23 09:35:02 +00:00

Update backend/src/plugins/Tags/docs.ts

Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
metal 2021-09-06 17:35:44 +01:00 committed by GitHub
parent 7f92a09eaa
commit 79e72185ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,12 +5,12 @@ export function generateTemplateMarkdown(definitions: TemplateFunction[]): strin
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") : null; const examples = def.examples?.map(ex => `> \`{${ex}}\``).join("\n") ?? null;
return trimPluginDescription(` return trimPluginDescription(`
## ${def.name} ## ${def.name}
**${def.description}**\n **${def.description}**\n
__Usage__: \`{${def.name}${usage}}\`\n __Usage__: \`{${def.name}${usage}}\`\n
${exampl ? `__Examples__:\n${exampl}` : ""}\n\n ${examples ? `__Examples__:\n${examples}` : ""}\n\n
`); `);
}) })
.join("\n\n"); .join("\n\n");