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

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -