-
Notifications
You must be signed in to change notification settings - Fork 781
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
POC: Add sprig library #1312
POC: Add sprig library #1312
Conversation
Here is a template that I used to experiment with Sprig (list, append, and sprig's join renamed as sprig_join)
|
Hey @angrycub, thanks for taking the time to submit a PR. I hadn't heard of the sprig library but this definitely looks like it could be useful. I'm not going to put this in the upcoming release (0.25.0) that I'm preparing for as this will take a bit of time to research and I'm not sure how to handle documentation for it (plus I really want to rework the documentation into a better format first). |
Can't wait to see it being merged! |
@freeseacher .. Thanks for the interest. Be sure to 👍 the PR (top post) to vote for this. We use the 👍's as a way to judge community priority. Thanks. |
It's very useful feature. Thank you! |
@eikenb - I was looking at this as I was rebasing it last, and I was thinking. What about if we decorate all of the sprig functions so that you could say that we provide them as |
@angrycub... I'm back! I like the idea of prefixing the functions to make it an obvious namespace. If you're still interested, please update the PR with your idea. Thanks! |
@angrycub, if you update this would you please consider adding at least a small/stub update to the documentation. Just a short something about the sprig project/library and a link to its documentation would be great. Thanks! |
Note to self. I spoke with @angrycub via slack (didn't notice they were another hashi employee) and he wants to look into another way of organizing it (inspired by hugo's template setup) and will re-submit. |
any update on this |
@angrycub .. were you still thinking about reworking your approach for this feature/PR? |
is there an update on this, it would be super useful |
would love this! |
I'll add this to the 0.28.0 milestone and look at it for that release. |
I looked into namespacing the sprig funcs, and it's (kind of) possible, but you end up having to upcase the first letter of the sprig function name so that they are exported funcs on a returned object. It's not the ugliest thing I've ever seen, but it does push it a little further away from the documented names--and seems to provide no real bonus usability compared to just whacking I can get this PR back into shape prepending |
I updated the early version PR comments to reflect the current truth of the PR (prefixes and for all the funcs and the sample template using the funcs) as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
Thanks!
[ninja edit: fixed referenced bug #] Fixes #1206 Seeing if that will auto-close the ticket. Not sure if comments trigger that. |
thanks for the quick update! |
This PR adds the Sprig template functions library. For clarity and ease of documentation, the sprig functions are renamed
sprig_«function»
.