Created
December 27, 2011 12:12
-
-
Save zeekay/1523445 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Render script inline using id kwarg: | |
- mustache id=test | |
%ul | |
%li | |
Hello {{name}} | |
%li | |
You have just won ${{value}}! | |
{{#in_ca}} | |
%li | |
Well, ${{taxed_value}}, after taxes. | |
{{/in_ca}} | |
becomes: | |
<script id="test" type="text/html"> | |
<ul> | |
<li> | |
Hello {{name}} | |
</li> | |
<li> | |
You have just won ${{value}}! | |
</li> | |
{{#in_ca}} | |
<li> | |
Well, ${{taxed_value}}, after taxes. | |
</li> | |
{{/in_ca}} | |
</ul> | |
</script> | |
Render mustache template directly with pystache using context kwarg | |
- mustache context=test | |
%ul | |
%li | |
Hello {{name}} | |
%li | |
You have just won ${{value}}! | |
{{#in_ca}} | |
%li | |
Well, ${{taxed_value}}, after taxes. | |
{{/in_ca}} | |
becomes: | |
<ul> | |
<li> | |
Hello Bob | |
</li> | |
<li> | |
You have just won $999! | |
</li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment