render template using given data
519669
function renderTemplate(template, css, data={}){
  
    // assign css
    data.inlinecss = css;

    // render template - use custom escape function to handle linebreaks!
    return _ejs.render(template, data, {
        escape: function(text){
            if (!text){
                return '';
            }

            // apply generic escape function
            text = _ejs.escapeXML(text);

            // linebreaks
            text = text.replace(/\n/g, '<br />');

            return text;
        }
    });
}
283342
def render(self, template, filename, context={}, filters={}):
        
        filename = os.path.normpath(filename)
        path, file = os.path.split(filename)
        try:
            os.makedirs(path)
        except OSError as exception:
            if exception.errno != errno.EEXIST:
                raise

        path, file = os.path.split(template)
        loader = jinja2.FileSystemLoader(path)
        env = jinja2.Environment(loader=loader, trim_blocks=True, lstrip_blocks=True)
        env.filters.update(filters)
        template = env.get_template(file)
        text = template.render(context)
        with open(filename, 'wt') as f:
            f.write(text)
919061
def render(self, template_name, **kw):
        '''
        
        '''
        logger.debug('Rendering template "%s"', template_name)
        vars = self.globs.copy()
        vars.update(kw)
        resolved_name, engine = self.resolve(template_name)
        return engine.render(resolved_name, **vars)
1290235
function render_template(type, object) {
  try {
    return new EJS({text: __templates[type]}).render(object);
  } catch (e) {
    //console.error(e);
    return "";
  }
}
273619
function render_with_layout(template, locals, cb) {
    render_file(locals, function(err, str) {
      if (err) {
        return cb(err);
      }

      locals.body = str;

      var res = template(locals, handlebarsOpts);
      self.async.done(function(values) {
        Object.keys(values).forEach(function(id) {
          res = res.replace(id, values[id]);
        });

        cb(null, res);
      });
    });
  }
1001906
def render_template(template, **context):
    
    parts = template.split('/')
    renderer = _get_renderer(parts[:-1])
    return renderer.render(renderer.load_template(parts[-1:][0]), context)
990619
def render_template(self):
        """"""
        self._parse_paths()
        context = dict(napp=self._napp.__dict__, paths=self._paths)
        self._save(context)
959813
function renderTemplate(templatePath, viewOpts, callback) {
  templateContent(templatePath, function(err, content) {
    if (err) {
      return callback(err, null);
    } else {
      return callback(null, Mustache.to_html(content, viewOpts));
    }
  });
}
381631
def render(self, data, div_id="chart", head=""):
        """"""
        if not self.is_valid_name(div_id):
            raise ValueError(
                "Name {} is invalid. Only letters, numbers, '_', and '-' are permitted ".format(
                    div_id))

        return Template(head + self.template).render(
            div_id=div_id.replace(" ", "_"),
            data=json.dumps(
                data, indent=4).replace("'", "\\'").replace('"', "'"))
1123004
def render_template(template_file, template_vars):
    """"""
    # Load our Jinja templates
    template_dir = "{0}/templates".format(
        os.path.dirname(os.path.abspath(__file__))
    )
    jinja_env = jinja2.Environment(
        loader=jinja2.FileSystemLoader(template_dir),
        trim_blocks=True
    )
    rendered = jinja_env.get_template(template_file).render(template_vars)

    return rendered
87332
public Renderable<?> render(Template template, Map<String, Object> parameters) {
        return template.render(this, parameters);
    }
1349819
def _render_template(param, username):
    '''
    
    '''
    env = Environment()
    template = env.from_string(param)
    variables = {'username': username}
    return template.render(variables)
1246094
def _render(self, data, formula_def):
        '''
        
        '''
        # FORMULA can contain a renderer option
        renderer = formula_def.get('renderer', self.opts.get('renderer', 'jinja|yaml'))
        rend = salt.loader.render(self.opts, {})
        blacklist = self.opts.get('renderer_blacklist')
        whitelist = self.opts.get('renderer_whitelist')
        template_vars = formula_def.copy()
        template_vars['opts'] = self.opts.copy()
        return compile_template(
            ':string:',
            rend,
            renderer,
            blacklist,
            whitelist,
            input_data=data,
            **template_vars
        )
62628
def render(template, context=None, **kwargs):
    
    renderer = Renderer()
    return renderer.render(template, context, **kwargs)
400136
function compile (template, data) {
    for (var name in data) {
      template = template.replace('{{' + name + '}}', data[name])
    }
    return template
  }
282844
function(el, template, context, opts) {
      opts = opts || {};
      if (_.isString(template)) {
        opts.newHTML = template;
      }
      templateRenderer.render(el, template, context, opts);
    }
976172
function render(template, vars) {
    var rendered = template;

    for (var key in vars) {
        if (vars.hasOwnProperty(key)) {
            var val = vars[key];
            var regExpString = '\\{' + key + '\\}';
            var regExp = new RegExp(regExpString, 'g');

            rendered = rendered.replace(regExp, val);
        }
    }

    return rendered;
}