stache (or other fragment based templating systems) return a document fragment, so 'hookup' steps are not required ##### render call `renderAs` with a hardcoded string, as view.render always operates against resolved template files or hardcoded strings
16865
function(view, data, helpers, callback) {
                    return can.view.renderAs("string", view, data, helpers, callback);
                }
960376
def render_javascript_template!(uri_path)
      javascript_match = File.join(settings.javascripts, "*")
      javascript_path  = File.expand_path(uri_path, settings.javascripts)

      return unless File.fnmatch(javascript_match, javascript_path)

      JAVASCRIPT_TEMPLATE_ENGINES.each do |engine, extension|
        @preferred_extension = extension.to_s
        find_template(settings.javascripts, uri_path, engine) do |file|
          next unless File.file?(file)
          halt send(extension, uri_path.to_sym, views: settings.javascripts)
        end
      end
    end
617576
def render(template, context = {})
      return nil unless exist?(template)

      path = File.join(@template_path, template + ".erb")
      layout_context = context.merge(partial: ERB.new(File.read(path)).result(Yokunai::RenderContext.new(context).get_binding))

      ERB.new(@raw_layout).result(Yokunai::RenderContext.new(layout_context).get_binding)
    end
830597
function TmplObject(markup, options) {
		// Template object constructor
		var htmlTag,
			wrapMap = $viewsSettings.wrapMap || {},
			tmpl = $extend(
				{
					markup: markup,
					tmpls: [],
					links: {},
					bnds: [],
					render: renderContent
				},
				options
			);

		if (!options.htmlTag) {
			// Set tmpl.tag to the top-level HTML tag used in the template, if any...
			htmlTag = rFirstElem.exec(markup);
			tmpl.htmlTag = htmlTag ? htmlTag[1].toLowerCase() : "";
		}
		htmlTag = wrapMap[tmpl.htmlTag];
		if (htmlTag && htmlTag !== wrapMap.div) {
			// When using JsViews, we trim templates which are inserted into HTML contexts where text nodes are not rendered (i.e. not 'Phrasing Content').
			tmpl.markup = $.trim(tmpl.markup);
			tmpl._elCnt = TRUE; // element content model (no rendered text nodes), not phrasing content model
		}

		return tmpl;
	}
264408
function(templateName, options) {
        var template = this.templates[templateName];
        if (!template) {
            throw new Error('Unknown template: ' + templateName);
        }

        if (typeof template === 'function') {
            var templateResult = template(options);
            return typeof templateResult === 'string' ? templateResult.trim() : templateResult;
        } else if (template.render) {
            return template.render(options).trim();
        } else {
            return template.toString().trim();
        }
    }
826526
function render() {
  const wicked = bewitched.get(this);
  const args = tta.apply(null, arguments);
  if (wicked && wicked.template === args[0]) {
    wicked.tagger.apply(null, args);
  } else {
    upgrade.apply(this, args);
  }
  return this;
}
69072
public static String render(String template, Map<String, Object> paras)
	{
		Template t = gt.getTemplate(template);
		t.binding(paras);
		return t.render();
	}
1031499
def render(view_options=configuration)
      logger.debug "rendering"
      result = ""
      if template
        logger.debug "rendering with template : #{template}"
        view = AppView.new(items, view_options)
        view.template = template
        result = view.render
      else
        items.each_with_index do |item, index|
          result += "\n" unless index == 0
          result += item.name.green + ":\n"
          if item.respond_to?(:attributes)
            attributes = item.attributes.deep_clone
            result += attributes.recursively_stringify_keys!.to_conf.gsub(/\s+$/, '') # strip trailing whitespace from YAML
            result += "\n"
          end
        end
      end
      result
    end
741425
def render(object = "fragment")
      xml = Builder::XmlMarkup.new(:indent => 2)
      file = File.read(File.expand_path("../../views/#{object}.xml.builder", __FILE__))
      instance_eval file
    end
766921
def render_template(template_name, context, format='png',
                    output=None, using=None, **options):
    
    # output stream, as required by casperjs_capture
    stream = BytesIO()
    out_f = None
    # the suffix=.html is a hack for phantomjs which *will*
    # complain about not being able to open source file
    # unless it has a 'html' extension.
    with NamedTemporaryFile(suffix='.html') as render_file:
        template_content = render_to_string(
            template_name,
            context,
            using=using,
        )
        # now, we need to replace all occurences of STATIC_URL
        # with the corresponding file://STATIC_ROOT, but only
        # if STATIC_URL doesn't contain a public URI (like http(s))
        static_url = getattr(settings, 'STATIC_URL', '')
        if settings.STATIC_ROOT and\
           static_url and not static_url.startswith('http'):
            template_content = template_content.replace(
                static_url,
                'file://%s' % settings.STATIC_ROOT
            )
        render_file.write(template_content.encode('utf-8'))
        # this is so that the temporary file actually gets filled
        # with the result.
        render_file.seek(0)

        casperjs_capture(
            stream,
            url='file://%s' % render_file.name,
            **options
        )

        # if no output was provided, use NamedTemporaryFile
        # (so it is an actual file) and return it (so that
        # after function ends, it gets automatically removed)
        if not output:
            out_f = NamedTemporaryFile()
        else:
            # if output was provided, write the rendered
            # content to it
            out_f = open(output, 'wb')
        out_f.write(stream.getvalue())
        out_f.seek(0)

        # return the output if NamedTemporaryFile was used
        if not output:
            return out_f
        else:
            # otherwise, just close the file.
            out_f.close()
271415
function render(view, options) {
  var self = this;
  options = options || {};

  for (var name in settings._filters) {
    options[name] = settings._filters[name];
  }

  if (settings.helpers) {
    for (var k in settings.helpers) {
      var helper = settings.helpers[k];
      if (typeof helper === 'function') {
        helper = helper(self.req, self);
      }
      if (!options.hasOwnProperty(k)) {
        options[k] = helper;
      }
    }
  }

  if (settings.filters) {
    for (var name in settings.filters) {
      options[name] = settings.filters[name];
    }
  }

  // add request to options
  if (!options.request) {
    options.request = self.req;
  }
  // render view template
  _render(view, options, function (err, str) {
    if (err) {
      return self.req.next(err);
    }
    var layout = typeof options.layout === 'string' ? options.layout : settings.layout;
    if (options.layout === false || !layout) {
      return send(self, str);
    }
    // render layout template, add view str to layout's locals.body;
    options.body = str;
    _render(layout, options, function (err, str) {
      if (err) {
        return self.req.next(err);
      }
      send(self, str);
    });
  });
  return this;
}
1309804
function renderJade(viewFiles, viewModel, callback) {
  var jadeFile = viewFiles[0];

  if (viewFiles.length > 1) {
    console.warn('TEMPLATES: More than one possible Jade view file found, will take main or index.');
    jadeFile = _.find(viewFiles, function (file) {
      return Path.basename(file, Path.extname(file)) === 'main' || Path.basename(file, Path.extname(file)) === 'index';
    });
  }

  if (jadeFile) {
    // Handle exports.
    viewModel.basedir = Path.join(__dirname, '../templates/jade/');
    
    Consolidate.jade(jadeFile, viewModel, function (err, html) {
      if (!err) {
        callback && callback(html);
      }
      else {
        console.error('TEMPLATES: Error generating view from Jade file ' + jadeFile, err);
        callback && callback();
      }
    });
  }
  else {
    console.warn('TEMPLATES: Could not find appropriate main Jade view file, please rename your main template to main.jade or index.jade.');
    callback && callback();
  }
}
1254343
def render context=nil, template_or_src=nil, &block
      compiled_template = compile(template_or_src, &block)
      context.instance_eval compiled_template
    end
653028
function view(name, model, cb) {
  var basePath = path.join(path.dirname(__filename), '../views');
  var render = function(err, files) {
    if (err) {
      cb(err);
    }
    cb(null, mustache.render(files[0], model, {
      toctreeChildren: files[1],
      func: files[2],
      member: files[3],
      constant: files[3],
      typedef: files[5]
    }));
  };
  async.parallel(_.map([
    name,
    '_toctree-children',
    '_function',
    '_member',
    '_member',
    '_typedef'
  ], function(p) {
    return function(cb) {
      fs.readFile(path.join(basePath, p + '.mustache'), 'utf-8', cb);
    };
  }), render);
}
753263
def render_view(parser, token):
    
    bits = token.split_contents()

    n = len(bits)
    if n < 2:
        raise TemplateSyntaxError("'%s' takes at least one view as argument")

    viewname = bits[1]

    kwargs = {}
    if n > 2:
        for bit in bits[2:]:
            match = kwarg_re.match(bit)
            if not match:
                raise TemplateSyntaxError("Malformed arguments to render_view tag")
            name, value = match.groups()
            if name:
                kwargs[name] = parser.compile_filter(value)

    return StringNode(viewname, kwargs)
563551
def render_with_scope(scope = nil, action = self.action_name, path = self.controller_path)
        templates = [ [path, action] ]
        templates << [path, scope, action] if scope
        
        if Sunrise::Config.scoped_views?
          templates << [path, abstract_model.plural, scope, action]
        end
        
        templates.reverse.each do |keys|
          name = File.join(*keys.compact.map(&:to_s))
          return render(:template => name) if template_exists?(name)
        end
      end
1083861
function(template, context, partials) {
      if(!this.includes("#", template) && !this.includes("^", template)) {
        // did not render anything, there were no sections
        return false;
      }

      var that = this;

      var regex = this.getCachedRegex("render_section", function(otag, ctag) {
        // This regex matches _the first_ section ({{#foo}}{{/foo}}), and captures the remainder
        return new RegExp(
          "^([\\s\\S]*?)" +         // all the crap at the beginning that is not {{*}} ($1)

          otag +                    // {{
          "(\\^|\\#)\\s*(.+)\\s*" + //  #foo (# == $2, foo == $3)
          ctag +                    // }}

          "\n*([\\s\\S]*?)" +       // between the tag ($2). leading newlines are dropped

          otag +                    // {{
          "\\/\\s*\\3\\s*" +        //  /foo (backreference to the opening tag).
          ctag +                    // }}

          "\\s*([\\s\\S]*)$",       // everything else in the string ($4). leading whitespace is dropped.

        "g");
      });


      // for each {{#foo}}{{/foo}} section do...
      return template.replace(regex, function(match, before, type, name, content, after) {
        // before contains only tags, no sections
        var renderedBefore = before ? that.render_tags(before, context, partials, true) : "",

        // after may contain both sections and tags, so use full rendering function
            renderedAfter = after ? that.render(after, context, partials, true) : "",

        // will be computed below
            renderedContent,

            value = that.find(name, context);

        if (type === "^") { // inverted section
          if (!value || that.is_array(value) && value.length === 0) {
            // false or empty list, render it
            renderedContent = that.render(content, context, partials, true);
          } else {
            renderedContent = "";
          }
        } else if (type === "#") { // normal section
          if (that.is_array(value)) { // Enumerable, Let's loop!
            renderedContent = that.map(value, function(row) {
              return that.render(content, that.create_context(row), partials, true);
            }).join("");
          } else if (that.is_object(value)) { // Object, Use it as subcontext!
            renderedContent = that.render(content, that.create_context(value),
              partials, true);
          } else if (typeof value === "function") {
            // higher order section
            renderedContent = value.call(context, content, function(text) {
              return that.render(text, context, partials, true);
            });
          } else if (value) { // boolean section
            renderedContent = that.render(content, context, partials, true);
          } else {
            renderedContent = "";
          }
        }

        return renderedBefore + renderedContent + renderedAfter;
      });
    }