Render a chart or page to local html files.

        :param chart: A Chart or Page object
        :param path: The destination file which the html code write to
        :param template_name: The name of template file.
424303
def render_chart_to_file(self, template_name: str, chart: Any, path: str):
        
        tpl = self.env.get_template(template_name)
        html = tpl.render(chart=self.generate_js_link(chart))
        write_utf8_html_file(path, self._reg_replace(html))
1023337
function View_renderFile(templateName, locals, viewsPath) {
            if (!viewsPath) {
                viewsPath = di.getAlias('viewsPath');
            }
            return this.swig.renderFile(viewsPath + templateName, locals);
        }
1058569
def _render_pipeline(path)
      filename_parts= path.split('.')
      begin
        ext= filename_parts.pop
        template_class= Renderer.for(ext)
        yield template_class unless template_class.nil?
      end while !template_class.nil? #and filename_parts.size
    end
400483
def render_workflow_html_template(filename, subtemplate, filelists, **kwargs):
    

    dirnam = os.path.dirname(filename)
    makedir(dirnam)

    try:
        filenames = [f.name for filelist in filelists for f in filelist if f is not None]
    except TypeError:
        filenames = []

    # render subtemplate
    subtemplate_dir = pycbc.results.__path__[0] + '/templates/wells'
    env = Environment(loader=FileSystemLoader(subtemplate_dir))
    env.globals.update(get_embedded_config=get_embedded_config)
    env.globals.update(path_exists=os.path.exists)
    env.globals.update(len=len)
    subtemplate = env.get_template(subtemplate)
    context = {'filelists' : filelists,
               'dir' : dirnam}
    context.update(kwargs)
    output = subtemplate.render(context)

    # save as html page
    kwds = {'render-function' : 'render_tmplt',
            'filenames' : ','.join(filenames)}
    save_html_with_metadata(str(output), filename, None, kwds)
1171906
def render_without_request(template_name, template_path=None, **template_vars):
    
    if template_path:
        env = Environment(loader=FileSystemLoader([os.path.join(template_path)]))
    else:
        env = ENV
    template = env.get_template(template_name)
    return template.render(**template_vars)
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)
1158741
def render_relative_path(export_path, path)
      export_path = Pathname.new(export_path)
      path = Pathname.new(path).relative_path_from(export_path)
      return path.to_path
    end
209591
def render_template_with_args_in_file(file, template_file_name, **kwargs):
    
    template_file_content = "".join(
        codecs.open(
            template_file_name,
            encoding='UTF-8'
        ).readlines()
    )
    template_rendered = string.Template(template_file_content).safe_substitute(**kwargs)
    file.write(template_rendered)
817534
def render_to_string(self, template, context=None, def_name=None, subdir='templates'):
        ''''''
        template_adapter = self.get_template_loader(subdir).get_template(template)
        return getattr(template_adapter, 'render')(context=context, request=self.request, def_name=def_name)
357935
function(path) {
                var pathParts = this.getPathParts(path),
                    tabs,
                    page;
                if (pathParts.length === 0) {
                    return;
                }
                page = pathParts[0];
                if (!page) {
                    return;
                }
                if (page === 'examples' && pathParts.length > 1) {
                    tabs = [];
                    tabs.push('app/examples/' + pathParts[1] + '.html');
                    tabs.push('app/examples/' + pathParts[1] + '.js');
                    return tabs;
                }
            }
948496
def render_template(template_name, **context):
    """"""
    tmpl = jinja_env.get_template(template_name)
    context["url_for"] = url_for
    return Response(tmpl.render(context), mimetype="text/html")
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()
634548
def render(self,
               data,
               chart_type,
               chart_package='corechart',
               options=None,
               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('"', "'"),
            chart_type=chart_type,
            chart_package=chart_package,
            options=json.dumps(
                options, indent=4).replace("'", "\\'").replace('"', "'"))
1211074
def load_template(self, path):
        
        if not path.startswith('/'):
            for folder in self.options['template_folders']:
                fullpath = op.join(folder, path)
                if op.exists(fullpath):
                    path = fullpath
                    break
            else:
                raise JadeException('Template doesnt exist: %s' % path)

        with open(path, 'rb') as f:
            source = f.read().decode(self.options['encoding'])

        return ExtendCompiler(
            pyjade.parser.Parser(source).parse(), pretty=self.options['pretty'],
            env=self, compileDebug=True
        )
1189959
def render_requests_data_to_html(self, data, file_name, context={}):
        """"""
        file_path = os.path.join(self.html_dir, file_name)
        logger.info('Rendering HTML file %s...' % file_path)
        data = format_data(data)
        data.update(context)
        data.update(domain=self.domain)
        with open(file_path, 'w') as fp:
            fp.write(render_template('realtime.html', data))
1113518
def render_template_for_path(request, path, context=None, use_cache=True, def_name=None):
    '''
    
    '''
    return get_template_for_path(path, use_cache).render(context, request, def_name)
1001577
function readTemplate(path) {
  var template = fs.readFileSync(__dirname + '/templates/' + path, 'utf8');
  for (var index in data) {
    template = template.split('__' + index + '__').join(data[index]);
  }
  return template;
}