Skip to content

Commit

Permalink
Merge pull request #16 from wuespace/clear-default-value-docs
Browse files Browse the repository at this point in the history
Clarify default values in Markdown `docs`
  • Loading branch information
pklaschka authored Dec 8, 2024
2 parents d4a53ac + 6d7f3b1 commit 24349d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/writers/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class DocsWriter implements Writer {
writeVariable(variable: Variable, prev: string): string {
// Heading
const optMarker = variable.optional ? " (optional)" : "";
prev += `\n### \`${variable.name}\`${optMarker}\n\n`;
prev += `\n### \`${variable.name}\`${optMarker}\n`;

// Description
variable.description?.split("\n").slice(0, -1).forEach((line) => {
Expand All @@ -35,6 +35,7 @@ export class DocsWriter implements Writer {
}

// Default value
prev += '#### Default Value\n\n';
prev += this.markdownCodeBlock(`${variable.name}=${variable.defaultValue}`);

// Example values
Expand Down

0 comments on commit 24349d1

Please sign in to comment.