Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an optional flag to remove the helm-docs version footer from the default template #220

Merged
merged 1 commit into from
Jul 6, 2024

Conversation

gbprz
Copy link
Contributor

@gbprz gbprz commented Feb 27, 2024

This change adds a new flag named skip-version-footer. When set to true, the version footer is removed from the default README template. By default, the flag is set to false so the version footer is kept for backwards compatibility.

I had a similar issue as this comment #162 (comment) where the default README template is great for the majority of our charts. For maintenance, it would be much easier for us to avoid copying README templates for each chart just to remove the version footer.

Fixes #162

@@ -26,7 +26,7 @@ func getOutputFile(chartDirectory string, dryRun bool) (*os.File, error) {
return f, err
}

func PrintDocumentation(chartDocumentationInfo helm.ChartDocumentationInfo, chartSearchRoot string, templateFiles []string, dryRun bool, helmDocsVersion string, badgeStyle string, dependencyValues []DependencyValues) {
func PrintDocumentation(chartDocumentationInfo helm.ChartDocumentationInfo, chartSearchRoot string, templateFiles []string, dryRun bool, helmDocsVersion string, badgeStyle string, dependencyValues []DependencyValues, skipVersionFooter bool) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this parameter list is getting long, I can create a struct to group similar parameters together either in this change or a follow up change if preferred.

For example, a PrintDocumentationParams for all params or a TemplateOpts struct that groups together settings like badgeStyle, helmDocsVersion, and skipVersionFooter that control the default template's behavior.

@gbprz gbprz marked this pull request as ready for review February 27, 2024 17:23
@mpluhar
Copy link

mpluhar commented Feb 27, 2024

I guess this PR would supercede my one to update at least the documentation
#219

@norwoodj
Copy link
Owner

norwoodj commented Mar 2, 2024

There have been requests to do this in the past and I still feel the same way:

If you don't want the versionFooter in your template, you can use a README.md.gotmpl file to define the template that you want to use when rendering your README. The default template is what it is, if you don't like it, there is already a mechanism to define your own. I don't want to go down the road of adding a ton of options to augment the default template like this.

@hstenzel
Copy link

hstenzel commented Apr 2, 2024

There have been requests to do this in the past and I still feel the same way:

If you don't want the versionFooter in your template, you can use a README.md.gotmpl file to define the template that you want to use when rendering your README. The default template is what it is, if you don't like it, there is already a mechanism to define your own. I don't want to go down the road of adding a ton of options to augment the default template like this.

Could you comment on the idea of keeping the footer but removing the version? I think that would solve the problem of unexpected/untimely changes that complicated workflows such as validation in CD and pre-commit.

Thanks!

@norwoodj
Copy link
Owner

norwoodj commented Jul 6, 2024

I'll merge it. Thanks for the changes, I've been convinced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to not include the helm-docs version in README
4 participants