Skip to content

Commit

Permalink
docs: add signature
Browse files Browse the repository at this point in the history
  • Loading branch information
axelrindle committed Aug 21, 2024
1 parent d85f2f4 commit a8220b4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/gen-docs-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>\`
Expand Down Expand Up @@ -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,
}))

Expand Down

0 comments on commit a8220b4

Please sign in to comment.