-
Notifications
You must be signed in to change notification settings - Fork 225
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
Need template examples up front. #1
Comments
You're right, it would be great to have some go examples. In the mean time I added a link to the examples folder of the original mustache project. |
I had a hard time getting started here too, as I am new to Go and new to Mustache and there are no good examples in the tree of providing Go input for complex configurations. https://gist.github.com/818727/5de46f2e242efb562a7a461567a5e9884e91569f Most important examples are index.mustache and musttest.go which shows making up and passing in a function that can be used with {{#name}}. Note the map[string]interface{} used to carry the lambda in "wrapped" Second most important example is postdata.go which shows how to construct a type system for your template's sections using map[string]string and map[string]interface{} or something a little more cleanly typed like map[string][]map[string]string... which is much easier to read for sure, with the type redirections shown, Post and Posts. You may not want to have composite or map literals in your production code, but to see what's going on the example written this way really helps! Feel free to adapt this code. If anyone can show a cleaner way to use ResultSet.Scan(...) with mustache, that would be a good next page, sorry also about the .8 files I accidentally committed! |
Implement the spec to make this a compliant implementation
In the main readme, it would be great if I could see a Hello World template in the Mustache language, as supported by this lib.
Thanks.
The text was updated successfully, but these errors were encountered: