egladman / crunchwrap Goto Github PK
View Code? Open in Web Editor NEWBarebones mustache-like templating written in pure Bash. That means no sed or awk.
Barebones mustache-like templating written in pure Bash. That means no sed or awk.
Instead of trying to predict everyone's use-cases I'll instead open up crunchwrap and allow variables to be piped to common utilities.
This introduces it's own set of problems though. This would allow the running of arbitrary code. We can take some steps to lockdown filters, but it's not a catchall. There will always be ways to circumvent any sense of security given the user is entering input.
Someone could easily wreck havoc with a oneliner like:
{{ variable | true && rm -rf $HOME }}
Here's some steps we can do to safen filters, but again it's not a catchall.
whitelist specific commands such as:
kill filter/command if it runs for more than X
seconds
As I start to build out this feature I'm sure I'll find more ways to improve the concept.
Variable:
example_var="The quick brown fox"
Template:
{{ example_var | awk '{$2="slow"; print $0} }} jumps over the lazy dog
Output:
The slow brown fox jumps over the lazy dog
functions like _eval_tags
and _parse
are begging to be rewritten. Their far too big, and difficult to follow.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.