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

Cannot include mustache/handlebar templates in example docs #164

Open
AlanMasciangelo opened this issue Sep 7, 2022 · 2 comments
Open
Labels
question Further information is requested

Comments

@AlanMasciangelo
Copy link

I was unable to find a way to "escape" code examples that contain mustache/handlebar templates that I may want to place in a README. Not surprisingly, it seems helm-docs tries to parse them as a go template. For example


My chart

Find the labelled pod

helper_pod="$(kubectl get pod -l app=my-app --template '{{range .items}}{{.metadata.name}}{{end}}')"    

@chgl
Copy link

chgl commented Oct 12, 2022

You should be able to escape the {{s:

helper_pod="$(kubectl get pod -l app=my-app --template '{{ `{{range .items}}` }} {{`{{.metadata.name}}`}} {{`{{end}}`}}')"

produces:

helper_pod="$(kubectl get pod -l app=my-app --template '{{range .items}} {{.metadata.name}} {{end}}')"

https://felix.ehrenpfort.de/notes/2022-03-01-escape-curly-braces-in-go-templates/

@Nepo26
Copy link
Collaborator

Nepo26 commented Jun 29, 2023

Did it work @AlanMasciangelo ?

@Nepo26 Nepo26 added the question Further information is requested label Jun 29, 2023
@Nepo26 Nepo26 added this to the General Cleanup milestone Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: No status
Development

No branches or pull requests

3 participants