From a8220b47a4f9879215b77745fc740bc962060b31 Mon Sep 17 00:00:00 2001 From: Axel Rindle Date: Wed, 21 Aug 2024 09:12:19 +0200 Subject: [PATCH] docs: add signature --- scripts/gen-docs-api.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/gen-docs-api.ts b/scripts/gen-docs-api.ts index a469c35..67a8ce1 100644 --- a/scripts/gen-docs-api.ts +++ b/scripts/gen-docs-api.ts @@ -19,12 +19,17 @@ type Options = { const template = compile(` Title: <%= name %> -Summary: <%= description %> -# \`<%= name %>(): <%= returns.type %>\` +# \`<%= name %>\` > <%= description %> +## Signature + +\`\`\`js +<%= name %>(<%= signature %>): <%= returns.type %> +\`\`\` + ## Return value \`<%= returns.type %>\` @@ -126,6 +131,7 @@ program.description('Generate documentation files for all exported API symbols.' .process(await template({ name: node.declaration.id.name, description: parsedComment.description, + signature: params.map(param => `${param.name}: ${param.type}`).join(', '), params, returns, examples, }))