defunkt / pystache

Mustache in Python
http://mustache.github.com/
MIT License
1.31k stars 308 forks source link

added 'multiple' option to command line render #165

Open berteh opened 10 years ago

berteh commented 10 years ago

Please merge this request pull. It adds a "--multiple" option to command line render of pystache that renders the provided template for each of the context children.
Output is saved in a file named per either a key in context, or a user-given string.

Usage (in pystache/pystache/tests/examples):

pystache multiple.mustache multiple.json -m out.html

to generate 3 files out-000.html, out-001.html, out-002.html; if there is no 'out.html' key in multiple.json

pystache multiple.mustache multiple.json -m NO

to generate 3 files, named from the value of 'NO' key in multiple.json