-
Notifications
You must be signed in to change notification settings - Fork 63
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
improving example? #57
Comments
Hey @gurugeek ! I'm not sure I get what you mean exactly, but the most basic set up is this;
|
@ninjabear many thanks for your reply! but why on all examples and this one you build a template? don't we call the template from html ?
also the old rustache seemed with a more clear example on how to achieve this
sorry if I am missing something obvious... |
oh! to use a file you can replace what I had in 1) with something like this:
I'm not sure what you mean about HTML, mustache isn't much concerned with the contents of the text files, it just treats them as mustache templates (looking for things like |
thank you @ninjabear yes I think this should really make it to the examples ! in 99% of the cases the point of mustache is to compile from a file (ok can be not just html ..but in many cases it will be) but perhaps it is already clear to the experts :) thanks again ! |
Yep totally see your point there @gurugeek! I'll submit a PR soon with a couple more examples |
I've created #58 with examples of |
@ninjabear thanks appreciated ! |
Hi @gurugeek, Hopefully you've found the examples provided by @ninjabear help your use-case! I just have one note to add:
We don't currently support this but it wouldn't be so hard to add something like that in future if you think it would be useful. Do you have a preference for how you might use the api?
Not really sure how to manage something like that, but maybe you and @ninjabear can come to an agreement if you like :) |
Hi and first of all thanks for your library! I had some issue with rustache so I am happy to see that there is an alternative. This said I was wondering if you could improve the example in a way to explain
a) how to define the template directory
b) how to achieve something as simple as
rustache::render_file("path/to/template.html", data);
is this done by template.render ? not very clear
c) call me old fashion but I plan to use this to display data fetched from a database. These would go a long way for real time use !
In short (mostly my fault probably ..new to rust) from the current docs I don't really understand how to get up and running(which in mustache should be define the template, pass the data, render it).
If any of the dev team needs someone to sponsor (aka pay) for the time to write them I would be happy to support the project.
The text was updated successfully, but these errors were encountered: