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

Collision between the actual helm-docs commands and the regular Markdown documentation of the helm charts #216

Open
ErikRosic opened this issue Feb 21, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ErikRosic
Copy link

The problem is that *.gotmpl is a go-template format, using {{...}} delimiters for template language.

And since helm charts are also go templates, and their documentation often lists helm/go template usage examples, during helm-docs processing a collision occurs between the actual helm-docs commands and the usual Markdown documentation of the helm charts.

In this case, helm-docs will dump on the first documentation yaml example.

The only solution is escaping, and it is abnormally complex/verbose/unreadable in go-template.
Although this solution works reliably, writing such a more complex documentation is unthinkable.

Expected Behavior

There can be several potential solutions:

(1)

In go-template those {{...}} delimiters are programmable, it should be possible to configure helm-docs to use other delimiters for the *.gotmpl source, and leave the {{...}} free for documentation purposes.

However, this option is not yet supported in helm-docs.

It should be relatively easy to add it to the helm-docs code and configuration.

(2)

Another option is to add support for including an external file to helm-docs, for example:

`this will load and include the file:
{{ template "helm-docs.include" "README.include.md" }}

tthis will generate the values section:
{{ template "chart.valuesSection" . }}`

Thank you.

Best regards,

Erik

@ErikRosic ErikRosic added the enhancement New feature or request label Feb 21, 2024
@norwoodj
Copy link
Owner

I think this is a reasonable ask. All that would be needed is to add a new command line argument for specifying the custom delimiters and then calling https://pkg.go.dev/text/template#Template.Delims on the template as we build it. Happy to look at a PR.

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

No branches or pull requests

3 participants