Skip to content

Commit

Permalink
Merge pull request #75 from bitnami-labs/allow-description-in-skip-lines
Browse files Browse the repository at this point in the history
Allow descriptions in skipped lines
  • Loading branch information
fmulero authored Oct 11, 2023
2 parents f9eb5fd + a095544 commit 44a4049
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ The following are the tags supported at this very moment:

- For a parameter: `## @param fullKeyPath [modifier?] Description`.
- For a section: `## @section Section Title"`.
- To skip an object and all its children: `## @skip fullKeyPath`.
- To skip an object and all its children: `## @skip fullKeyPath Description?`.
- To add a description for an intermediate object (i.e. not final in the YAML tree): `## @extra fullkeyPath Description`.

All the tags as well as the two initial `#` characters for the comments style can be configured in the [configuration file](#configuration-file).
Expand Down
2 changes: 1 addition & 1 deletion lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function parseMetadataComments(valuesFilePath, config) {
const descriptionStartRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.descriptionStart}\\s*(.*)`);
const descriptionContentRegex = new RegExp(`^\\s*${config.comments.format}\\s*(.*)`);
const descriptionEndRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.descriptionEnd}\\s*(.*)`);
const skipRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.skip}\\s*(.*)$`);
const skipRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.skip}\\s*([^\\s]+)\\s*(.*)$`);
const extraRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.extra}\\s*([^\\s]+)\\s*(\\[.*?\\])?\\s*(.*)$`);

// We assume there will always be a section before any parameter. At least one section is required
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitnami/readme-generator-for-helm",
"version": "2.5.1",
"version": "2.5.2",
"description": "Autogenerate READMEs tables and OpenAPI schemas for Helm Charts",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion tests/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ containerSecurityContext:
## Kubewatch resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
## @skip resources
## @skip resources Optional description
## @disabled-param resources.limits The resources limits for the Kubewatch container
## @disabled-param resources.requests The requested resources for the Kubewatch container
##
Expand Down

0 comments on commit 44a4049

Please sign in to comment.