Skip to content

Commit

Permalink
Update documentation - auto generate "extensions" section (#172)
Browse files Browse the repository at this point in the history
* Update documentation - auto generate "extensions" section

* address comment

* update sub header

* nit
  • Loading branch information
samruddhikhandale authored Apr 14, 2023
1 parent 9b0f84a commit 50511f4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/generateDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const FEATURES_README_TEMPLATE = `
\`\`\`
#{OptionsTable}
#{Customizations}
#{Notes}
---
Expand Down Expand Up @@ -137,6 +137,14 @@ async function _generateDocumentation(basePath: string, readmeTemplate: string,
}
}

let extensions = '';
if (parsedJson?.customizations?.vscode?.extensions) {
const extensionsList = parsedJson.customizations.vscode.extensions;
if (extensionsList && extensionsList.length > 0) {
extensions = '\n## Customizations\n\n### VS Code Extensions\n\n' + extensionsList.map((ext: string) => `- \`${ext}\``).join('\n') +'\n';
}
}

let newReadme = readmeTemplate
// Templates & Features
.replace('#{Id}', parsedJson.id)
Expand All @@ -148,7 +156,8 @@ async function _generateDocumentation(basePath: string, readmeTemplate: string,
// Features Only
.replace('#{Registry}', ociRegistry)
.replace('#{Namespace}', namespace)
.replace('#{Version}', version);
.replace('#{Version}', version)
.replace('#{Customizations}', extensions);

if (header) {
newReadme = header + newReadme;
Expand Down

0 comments on commit 50511f4

Please sign in to comment.