How to use the render function from swig
Find comprehensive JavaScript swig.render code examples handpicked from public code repositorys.
GitHub: byjpr/boojum
31 32 33 34 35 36 37 38 39 40 41 42
return compile.join('\n'); }, forTag.ends, true); function swigRenderer(data, locals) { return swig.render(data.text, { locals, filename: data.path, }); }
3
3
0
+ 3 other calls in file
104 105 106 107 108 109 110 111 112 113
if (metadatas.length) { // console.log(metadatas) headerFile = swig.render(headerTemplate, {locals:{items:metadatas}}); //console.log(headerFile); impFile = swig.render(impTemplate, {locals:{items:metadatas}}) //console.log(impFile); fs.writeFileSync(path.normalize('orm.h'), headerFile) fs.writeFileSync(path.normalize('orm.m'), impFile) };
0
3
3
+ 3 other calls in file
GitHub: zeonjs/zeon-ms-05
118 119 120 121 122 123 124 125 126
var locals = { _root: page_relative_path, _uri: uri }; locals = _.assign(data.data, locals); var content = swig.render(temp, { locals: locals, filename: path.join(config.dir._root, encodeURIComponent(data.path)) });
1
0
0
3410 3411 3412 3413 3414 3415 3416 3417 3418 3419
* @example * var swig = require('swig'); * var myswig = new swig.Swig({varControls: ['<%=', '%>']}); * myswig.render('Tacos are <%= tacos =>!', { locals: { tacos: 'delicious' }}); * // => Tacos are delicious! * swig.render('Tacos are <%= tacos =>!', { locals: { tacos: 'delicious' }}); * // => 'Tacos are <%= tacos =>!' * * @param {SwigOpts} [opts={}] Swig options object. * @return {object} New Swig environment.
0
1
0
+ 3 other calls in file
GitHub: HappyBite/cms-render
94 95 96 97 98 99 100 101 102
} //console.log(swig.render(args[2] +'-t')); //console.log(swig.compile(args[2] +'-t')); //var path = args[0].replace(/'/, '').replace(/'/, ''); //var url = args[1].replace(/'/, '').replace(/'/, ''); //console.log('compiler', swig.render('{{routes}}')) //console.log('compiler', parents) //options.valuee = 'gaga'; //content[1]['valuee'] = function(){return 'adf'};
0
0
0
+ 6 other calls in file
swig.compileFile is the most popular function in swig (1638 examples)