-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Document suppressing newlines. #450
Conversation
I found myself writing multi-line action blocks to improve readability but could not understand why each action left a newline behind. Because I was running this in Docker Compose, I didn't want to alter the `ENTRYPOINT` to your image to do some data munging with `bash` to workaround it. I saw that some example code in your documentation had leading and trailing minus signs after and before the action delimiters. I figured this was worth something, so I used it in my code and discovered that this is how you suppress newlines. While this is well-known for those that use Go templates, it wasn't clear to this not-yet-a-Golang dev. I added some documentation to explain this better for folks like me. I love this tool! Thank you for making it!
Hi @carlosonunez! Thanks so much for this submission. I find it difficult sometimes to write docs from the perspective of a non-Go-dev, so I appreciate this type of PR all the more! 😄 Overall, this is excellent. I have a few minor nitpicks, which I will add suggestions for in-line, and you can accept or reject them 😉 |
It would be useful to also reference the Go template documentation for those who are interested in digging deeper: https://golang.org/pkg/text/template/#hdr-Text_and_spaces |
Co-Authored-By: carlosonunez <[email protected]>
Agreed! I thought of doing this but didn’t know where to put it. Hang on. |
Reference Golang template behaviour.
Co-Authored-By: carlosonunez <[email protected]>
Done! |
@carlosonunez thanks again for this! I'm glad gomplate is useful for you 🙂 |
I found myself writing multi-line action blocks to improve readability but could not understand why each action left a newline behind. Because I was running this in Docker Compose, I didn't want to alter the
ENTRYPOINT
to your image to do some data munging withbash
to workaround it.I saw that some example code in your documentation had leading and trailing minus signs after and before the action delimiters. I figured this was worth something, so I used it in my code and discovered that this is how you suppress newlines.
While this is well-known for those that use Go templates, it wasn't clear to this not-yet-a-Golang dev. I added some documentation to explain this better for folks like me.
I love this tool! Thank you for making it!