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

Document suppressing newlines. #450

Merged
merged 4 commits into from
Dec 21, 2018

Conversation

carlosonunez
Copy link
Contributor

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!

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!
@hairyhenderson
Copy link
Owner

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 😉

@hairyhenderson
Copy link
Owner

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

@carlosonunez
Copy link
Contributor Author

Agreed! I thought of doing this but didn’t know where to put it. Hang on.

carlosonunez and others added 2 commits December 20, 2018 22:07
Reference Golang template behaviour.
@carlosonunez
Copy link
Contributor Author

Done!

@hairyhenderson
Copy link
Owner

@carlosonunez thanks again for this! I'm glad gomplate is useful for you 🙂

@hairyhenderson hairyhenderson merged commit c8833d6 into hairyhenderson:master Dec 21, 2018
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.

2 participants