filippo / sgte Goto Github PK
View Code? Open in Web Editor NEWA simple Erlang Template Engine
Home Page: https://github.com/filippo/sgte
A simple Erlang Template Engine
Home Page: https://github.com/filippo/sgte
Add docs to the wiki
As far as I am aware at the moment the only way to iterate over an array is a map
operation. I think adding a StringTemplate style iteration would be great. I mean something like this:
$["john","mary", "mark", "peter"]:{ it | <b>name:</b> $it$}
Also, this should work for non-array values (treating such value as one-element array)
EDIT: It's just come to me that this is in fact an extension of http://github.com/filippo/sgte/issues/3 (applying function to an attribute) :-)
Add template inheritance feature from StringTemplate
There where some interesting changes/fixes a few months ago. time to cut a new release.
Apply should take multiple attributes:
$apply f var1 var2 var3$
translates to f(var1, var2, var3)
in the same way we could write something like:
$(var1, var2, var3):f$
If rendering fails due to wrong data type or missing attribute in data, it should return {error, Reason}. If rendering is successful, it should return {ok, string()}.
Currently there is no way to check at runtime if rendering failed or no.
To maintain backward compatibility a new flag (e.g. raise_error) should be added to options. If this flag is set and rendering fails {error, Reason} should be returned else string() should be returned.
Line 317 of sgte_parse.erl - the function parse_ift has a different arity than the docstring, causing edoc, which is java-like-paranoid about such things, to not compile all the docs.
Improve unicode implementation with options in the compile and render phase to correctly handle input and output encodings
Add some syntactic to apply. E.g.
might be written as:
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.