You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command line version of pystache always treats the template argument as a string. Based on the documentation, it should recognize a file if one exists, which is how the context argument currently works.
echo"Hello {{world}}"> template
echo'{"world": "everybody"}'> context
# expecting "Hello everybody" but the actual result is "template"
pystache template context
Actually it seems like it work as advertised for me now (pystache==0.5.4). . . even with my own test case posted above. I'm not sure why I was seeing this before . . .
Edit . . . nevermind. You are correct. I had a .mustache template hanging around which is why I thought my original test case was working.
pystache template context will automatically look for 'template.mustache' and use that if found.
Three years after this was originally reported, I had to dig through source code and issues to find out that it expects filenames ending with the magic string .mustache.
I recommend adding --context-file, --context-string, --template-file, and --template-string.
This leaves alone the behavior of the overloaded positional arguments, in case some users depend on that behavior.
Update: now that I've got pystache3 working, I just want you to know that I find it quite useful. Thanks!
The command line version of pystache always treats the template argument as a string. Based on the documentation, it should recognize a file if one exists, which is how the context argument currently works.
pystache/pystache/commands/render.py
Line 72 in 17a5dfd
The text was updated successfully, but these errors were encountered: