Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

precompile-global.js 602B

12345678910111213141516171819202122
  1. 'use strict';
  2. function precompileGlobal(templates, opts) {
  3. var out = '';
  4. opts = opts || {};
  5. for (var i = 0; i < templates.length; i++) {
  6. var name = JSON.stringify(templates[i].name);
  7. var template = templates[i].template;
  8. out += '(function() {' + '(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})' + '[' + name + '] = (function() {\n' + template + '\n})();\n';
  9. if (opts.asFunction) {
  10. out += 'return function(ctx, cb) { return nunjucks.render(' + name + ', ctx, cb); }\n';
  11. }
  12. out += '})();\n';
  13. }
  14. return out;
  15. }
  16. module.exports = precompileGlobal;