Given a URI path, attempts to render a JavaScript template, if it exists, and halt

 @param [String] uri_path
 @see JAVASCRIPT_TEMPLATE_ENGINES
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
939777
def render_template(self, template_path, context=None):
        
        warnings.warn(
            "ResourceLoader.render_template has been deprecated in favor of ResourceLoader.render_django_template"
        )
        return self.render_django_template(template_path, context)
1062454
function( path, callback ) {
		var match = munit.isRegExp( render.options.file_match ) ? render.options.file_match : rtestfile;

		path += '/';
		fs.readdir( path, function( e, files ) {
			if ( e ) {
				return callback( e );
			}

			async.each( files || [],
				function( file, callback ) {
					var fullpath = path + file;

					fs.stat( fullpath, function( e, stat ) {
						if ( e ) {
							callback( e );
						}
						else if ( stat.isDirectory() ) {
							render._renderPath( fullpath, callback );
						}
						else {
							if ( stat.isFile() && match.exec( file ) ) {
								munit.require( fullpath );
							}

							callback();
						}
					});
				},
				callback
			);
		});
	}
100171
function buildTemplatePartial(path) {
  
  var tplDir = app.mvcpath + app.paths.templates;
  var p = path.replace(tplDir, '');
  var pos = p.indexOf('.');
  var ext = p.slice(pos+1);
  var tpl = p.slice(0,pos);

  if (ext in this.enginesByExtension) {
    
    var engine = this.enginesByExtension[ext];
    var func = engine.renderPartial(path);
    
    func.engine = engine;
    func.ext = ext;
    
    this.templates[tpl] = func;
    
  } else {
    
    throw new Error(util.format("Unable to render %s: engine not loaded",  this.relPath(path)));
    
  }
  
}
206023
def render_mako_template(self, template_path, context=None):
        
        context = context or {}
        template_str = self.load_unicode(template_path)
        lookup = MakoTemplateLookup(directories=[pkg_resources.resource_filename(self.module_name, '')])
        template = MakoTemplate(template_str, lookup=lookup)
        return template.render(**context)
591548
def read_template
      path = @template_filepath
      if @gem_included_template
        relative_path = "../../#{@template_filepath}"
        path = File.expand_path(relative_path, File.dirname(__FILE__))
      end
      @html = File.read(path)
    end
1109155
def render(context_scope = nil, locals = nil, &block)
      apply(context_scope, locals, &block) if context_scope || locals || block

      cache_results do
        send("to_#{@_options[:format]}")
      end
    end
760998
def build_template(template_path)
      # FIXME: this is called every time build_template is called.
      # although this is idepodent, it's got room for optimization
      self.build_components!

      ERB.new( File.open( template_path ).read, nil, '<>' ).result(self.binding)
    end
110942
def render_copy from_source_path
      source_path = "#{ActiveCopy.content_path}/#{from_source_path}.md"

      if File.exists? source_path
        raw_source = IO.read source_path
        source = raw_source.split("---\n")[2]
        template = ActiveCopy::Markdown.new
        template.render(source).html_safe
      else
        raise ArgumentError.new "#{source_path} does not exist."
      end
    end
803641
def uri_join(*paths)
      return nil if paths.length == 0
      leadingslash = paths[0][0] == '/' ? '/' : ''
      trailingslash = paths[-1][-1] == '/' ? '/' : ''
      paths.map! { |path| path.sub(/^\/+/, '').sub(/\/+$/, '') }
      leadingslash + paths.join('/') + trailingslash
    end
879123
function renderTemplateFile(engine, filePath, context) {
    var loader = engine.getLoader();

    // Resolve the filePath
    var resolvedFilePath = loader.resolve(null, filePath);

    return Promise()
    .then(function() {
        if (!loader.async) {
            return loader.getSource(resolvedFilePath);
        }

        var deferred = Promise.defer();
        loader.getSource(resolvedFilePath, deferred.makeNodeResolver());
        return deferred.promise;
    })
    .then(function(result) {
        if (!result) {
            throw error.TemplateError(new Error('Not found'), {
                filename: filePath
            });
        }

        return render(engine, result.path, result.src, context);
    });

}
1116113
def render_template(view, template, layout_name, locals)
      path = template.identifier

      result = path.match(/(?<=\/)[a-zA-Z0-9_-]+(?=\/app\/views)/)
      result = result.to_s.split('-').first.to_s + '/engine'

      engine = result.classify.safe_constantize

      view.instance_variable_set(:@_rendered_from, engine.root) if engine

      super
    end
1333465
def render_path(self, template_path, *context, **kwargs):
        
        loader = self._make_loader()
        template = loader.read(template_path)

        return self._render_string(template, *context, **kwargs)
980834
function resetUriRouteHandlers() {
  /**
   * URIs can point to many different things, and this list will probably grow.
   * @type {[{when: RegExp, html: function, json: function}]}
   */
  uriRoutes = [
    // assume published
    {
      when: /\/_pages\//,
      default: assumePublishedUnlessEditing(renderPage),
      json: assumePublishedUnlessEditing(getDBObject)
    },
    // assume published
    {
      when: /\/_components\//,
      default: assumePublishedUnlessEditing(renderComponent),
      json: assumePublishedUnlessEditing(components.get)
    },
    // uris are not published, they only exist
    {
      when: /\/_uris\//,
      isUri: true,
      html: renderUri,
      json: db.get
    }];
}
660680
function renderExpressRoute(req, res, next) {
  var hrStart = process.hrtime(),
    site = res.locals.site,
    prefix = `${getExpressRoutePrefix(site)}/_uris/`,
    pageReference = `${prefix}${buf.encode(req.hostname + req.baseUrl + req.path)}`;

  return module.exports.renderUri(pageReference, req, res, hrStart)
    .catch((error) => {
      if (error.name === 'NotFoundError') {
        log('error', `could not find resource ${req.uri}`, {
          message: error.message
        });
        next();
      } else {
        next(error);
      }
    });
}
438631
def yield_html
      if (template_path = attrs.content_template_path)
        @yield_renderer ||= StringTemplateRenderer.new(@volt_app, attrs.content_controller, template_path)
        @yield_renderer.html
      else
        # no template, empty string
        ''
      end
    end
384030
function renderUri(uri, req, res, hrStart) {
  hrStart = hrStart || process.hrtime(); // Check if we actually have a start time

  return db.get(uri).then(function (result) {
    const route = _.find(uriRoutes, function (item) {
      return result.match(item.when);
    });

    if (!route) {
      throw new Error('Invalid URI: ' + uri + ': ' + result);
    }

    if (route.isUri) {
      let newBase64Uri = _.last(result.split('/')),
        newUri = buf.decode(newBase64Uri),
        newPath = url.parse(`${res.req.protocol}://${newUri}`).path,
        newUrl = `${res.req.protocol}://${res.req.hostname}${newPath}`,
        queryString = req._parsedUrl.search;

      if (queryString) newUrl += queryString;

      log('info', `Redirecting to ${newUrl}`);
      res.redirect(301, newUrl);
    } else {
      return route.default(result, req, res, hrStart);
    }
  });
}