Skip to content

Commit

Permalink
Add support for Documentation section
Browse files Browse the repository at this point in the history
  • Loading branch information
amckinney committed May 27, 2024
1 parent 05e2d2d commit 4a44b5b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/generator-cli/src/readme/ReadmeGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export class ReadmeGenerator {
public async generateReadme({ output }: { output: fs.WriteStream }): Promise<void> {
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 }));
}
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 4a44b5b

Please sign in to comment.