javascript - SWIG template widhout node - it is possible to use it as standalone js library? -
There are some great JS template engines for Django programmers:
but it is available for NPN package Node.js. And the file requires a path to render:
swig.renderFile ('/ path / to / template.html', {pagename: 'horrible people', writers: [' Paul ',' Jim ',' Jane ']});
Is it usable like other JS / JK library and renders templates with string?
Yes, you only use the render (source, option)
method can do.
var output = swig.render ('{{takos}}', {local: {takos: 'tacos !!!!'}});
Unless you do not mean that you want to run it in the browser, take a look at it.
Comments
Post a Comment