From 4a44b5b0d9cba52a527fee8fe0b964266f5c0893 Mon Sep 17 00:00:00 2001 From: Alex McKinney Date: Mon, 27 May 2024 17:58:35 -0400 Subject: [PATCH] Add support for Documentation section --- .../generator-cli/src/readme/ReadmeGenerator.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/generator-cli/src/readme/ReadmeGenerator.ts b/packages/generator-cli/src/readme/ReadmeGenerator.ts index 87982a4e8a..5051e88c0b 100644 --- a/packages/generator-cli/src/readme/ReadmeGenerator.ts +++ b/packages/generator-cli/src/readme/ReadmeGenerator.ts @@ -41,6 +41,9 @@ export class ReadmeGenerator { public async generateReadme({ output }: { output: fs.WriteStream }): Promise { const blocks: Block[] = []; + if (this.readmeConfig.docsLink != null) { + blocks.push(this.generateDocumentation({ docsLink: this.readmeConfig.docsLink })); + } if (this.snippets.requirements != null) { blocks.push(this.generateRequirements({ requirements: this.snippets.requirements })); } @@ -199,6 +202,18 @@ export class ReadmeGenerator { ); } + private generateDocumentation({ docsLink }: { docsLink: string }): Block { + const writer = new StringWriter(); + writer.writeLine("## Documentation"); + writer.writeLine(); + writer.writeLine(`${this.organization} documentation is available [here](${docsLink}).`); + writer.writeLine(); + return new Block({ + id: "DOCUMENTATION", + content: writer.toString(), + }); + } + private generateRequirements({ requirements }: { requirements: string[] }): Block { const writer = new StringWriter(); writer.writeLine("## Requirements");