plush
plush copied to clipboard
Render Plush templates from Command Line
I have started using Plush in one of my project. Firstly, Good work :+1: As a part of the code pipeline, some of the Plush templates need to be validated for consistency and the output they will render.
Inspired from the erb command line tool, I have added support to plush binary to render a given template based on CLI vars or input JSON file.
Example Usage:
meson10@xps:~/workspace/plush$ cat hello.plush
Hello, <%= name %>
meson10@xps:~/workspace/plush$ plush render hello.plush
Hello,
meson10@xps:~/workspace/plush$ cat test.json
{"name": "world"}
meson10@xps:~/workspace/plush$ plush render hello.plush -c test.json
Hello, world
meson10@xps:~/workspace/plush$ plush render hello.plush -v name=Mark
Hello, Mark
If this is of merit to your code I can send a PR. Alternatively, Please suggest if there is a better way to achieve the desired functionality.
That sounds great! I would love to see the plush binary get that.
@markbates Ok cool. Sending PR.
@markbates https://github.com/gobuffalo/plush/pull/20