Render your CrudKit app and output to HTML
772813
public function render () {
        $content = $this->renderToString();

        if ($this->redirect !== null) {
            header("Location: ".$this->redirect);
            session_write_close();
            exit();
            return;
        }

        // Headers are also calculated in render to string
        if($this->isJsonResponse()) {
            header("Content-type: application/json;");
        }


        echo $content;
        exit ();
    }
132602
def render(self, context):
        
        notifications = self.obj.resolve(context)
        return self.generate_html(notifications)
884715
public function renderJs(): void
	{
		$el = Html::el('script type="text/javascript"');
		$el->addText('window.twttr=(function(d,s,id){var t,js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}js=d.createElement(s);js.id=id;js.src="' . self::TWITTER_PLATFORM_URL . '";fjs.parentNode.insertBefore(js,fjs);return window.twttr||(t={_e:[],ready:function(f){t._e.push(f)}})}(document,"script","twitter-wjs"));');

		echo $el;
	}
38959
function (cb) {
            var self = this,
                stack = new Y.Parallel();

            Y.log('Preparing index.html', 'info', 'builder');
            self.renderIndex(stack.add(function (html, view) {
                stack.html = html;
                stack.view = view;
                if (self.options.dumpview) {
                    Y.Files.writeFile(path.join(self.options.outdir, 'json', 'index.json'), JSON.stringify(view), stack.add(noop));
                }
                Y.Files.writeFile(path.join(self.options.outdir, 'index.html'), html, stack.add(noop));
            }));

            stack.done(function ( /* html, view */ ) {
                Y.log('Writing index.html', 'info', 'builder');
                cb(stack.html, stack.view);
            });
        }
735182
def generate_html(self, jdoc, schema, schemas):
        ''''''

        params = {'functions': sorted([j for j in jdoc \
                   if (j.schema_name == schema.object_name and j.object_type \
                       in ['function', 'procedure', 'trigger'])], \
                                      key=lambda x: x.object_name),
                   'tables': sorted([j for j in jdoc \
                   if (j.schema_name == schema.object_name and j.object_type \
                       in ['table', 'view', 'materialized view', 'foreign table'])], \
                                    key=lambda x: x.object_name),
                   'schema_name': schema.object_name,
                   'schemas': sorted(schemas, key=lambda x: x.object_name),
                   'project': self.project_name,
                   'title': '{}: schema {}'.format(self.project_name,
                                                   schema.object_name)}
        template = self.lookup.get_template('schema.mako')
        html = template.render_unicode(**params)

        return html
1200499
def render(template, extra={}, **kwargs):
    """"""
    context = hookenv.execution_environment()
    context.update(extra)
    context.update(kwargs)
    return template.format(**context)
978988
def render(self, sphinx_app: Sphinx, context):
        

        # Called from kaybee.plugins.widgets.handlers.render_widgets

        builder: StandaloneHTMLBuilder = sphinx_app.builder
        resource = sphinx_app.env.resources[self.docname]
        context['sphinx_app'] = sphinx_app
        context['widget'] = self
        context['resource'] = resource

        # make_context is optionally implemented on the concrete class
        # for each widget
        self.make_context(context, sphinx_app)

        # NOTE: Can use builder.templates.render_string
        template = self.template + '.html'
        html = builder.templates.render(template, context)
        return html
86033
def render(self, renderer=None, **kwargs):
        
        return Markup(get_renderer(current_app, renderer)(**kwargs).visit(
            self))
303496
def rstjinja(app, docname, source):
    
    # Make sure we're outputting HTML
    if app.builder.format != 'html':
        return
    src = source[0]
    rendered = app.builder.templates.render_string(
        src, app.config.html_context
    )
    source[0] = rendered
680117
function render(output, data, node) {
        // data is a model id
        var manager = Jupyter.notebook && Jupyter.notebook.kernel && Jupyter.notebook.kernel.widget_manager;
        if (!manager) {
            node.textContent = "Error rendering Jupyter widget: missing widget manager";
            return;
        }

        // Missing model id means the view was removed. Hide this element.
        if (data.model_id === '') {
            node.style.display = 'none';
            return;
        }

        var model = manager.get_model(data.model_id);
        if (model) {
            model.then(function(model) {
                return manager.display_model(void 0, model, {output: output});
            }).then(function(view) {
                var id = view.cid;
                output._jupyterWidgetViews = output._jupyterWidgetViews || [];
                output._jupyterWidgetViews.push(id);
                views[id] = view;
                PhosphorWidget.Widget.attach(view.pWidget, node);

                // Make the node completely disappear if the view is removed.
                view.once('remove', () => {
                    // Since we have a mutable reference to the data, delete the
                    // model id to indicate the view is removed.
                    data.model_id = '';
                    node.style.display = 'none';
                })
            });
        } else {
            node.textContent = 'A Jupyter widget could not be displayed because the widget state could not be found. This could happen if the kernel storing the widget is no longer available, or if the widget state was not saved in the notebook. You may be able to create the widget by running the appropriate cells.';
        }
    }
7246
def render_table(output_dir, packages, jenv=JENV):
  
  destination_filename = output_dir + "/com/swiftnav/sbp/client/MessageTable.java"
  with open(destination_filename, 'w+') as f:
      print(destination_filename)
      f.write(jenv.get_template(TEMPLATE_TABLE_NAME).render(packages=packages))
417033
function _renderAppShell(res) {
  res.render(appShell.view, {
      layout    : appShell.layout
    , appTitle  : appConfig.appTitle
    , appConfig : JSON.stringify(appConfig)
    , appData   : JSON.stringify(appData)
  });
}
463105
def _render(template, render, renderer, template_dict, opts):
    '''
    
    '''
    if render:
        if template_dict is None:
            template_dict = {}
        if not renderer:
            renderer = opts.get('renderer', 'jinja|yaml')
        rend = salt.loader.render(opts, {})
        blacklist = opts.get('renderer_blacklist')
        whitelist = opts.get('renderer_whitelist')
        ret = compile_template(template, rend, renderer, blacklist, whitelist, **template_dict)
        if salt.utils.stringio.is_readable(ret):
            ret = ret.read()
        if six.text_type(ret).startswith('#!') and not six.text_type(ret).startswith('#!/'):
            ret = six.text_type(ret).split('\n', 1)[1]
        return ret
    with salt.utils.files.fopen(template, 'r') as fh_:
        return fh_.read()
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()
584050
def render_template(self):
        """"""
        self.import_mappings()
        self.create_template()
        if self.description:
            self.set_template_description(self.description)
        self.setup_parameters()
        rendered = self.template.to_json(indent=self.context.template_indent)
        version = hashlib.md5(rendered.encode()).hexdigest()[:8]
        return (version, rendered)
31308
def render_node(_node_id, value=None, noderequest={}, **kw):
    ""
    if value == None:
        kw.update( noderequest )
        results = _query(_node_id, **kw)
        current_app.logger.debug("results: %s", results)
        if results:
            values = []
            for (result, cols) in results:
                if set(cols) == set(['node_id', 'name', 'value']):
                    for subresult in result:
                        #if subresult.get('name') == kw.get('name'):
                            # This is a link node
                        current_app.logger.debug("sub: %s", subresult)
                        name = subresult['name']
                        if noderequest.get('_no_template'):
                            # For debugging or just simply viewing with the
                            # operate script we append the node_id to the name
                            # of each. This doesn't work with templates.
                            name = "{0} ({1})".format(name, subresult['node_id'])
                        values.append( {name: render_node( subresult['node_id'], noderequest=noderequest, **subresult )} )
                #elif 'node_id' and 'name' in cols:
                #    for subresult in result:
                #        current_app.logger.debug("sub2: %s", subresult)
                #        values.append( {subresult.get('name'): render_node( subresult.get('node_id'), **subresult )} )
                else:
                    values.append( result )

            value = values

    value = _short_circuit(value)
    if not noderequest.get('_no_template'):
        value = _template(_node_id, value)

    return value
811147
function render(profile, callback) {
	Mu.compile('hcard.html.mu', function (err, parsed) {
	    if (err) return callback(err);
	    
	    var buffer = '';
	    Mu.render(parsed, profile)
	      .on('data', function (c) { buffer += c.toString(); })
	      .on('end', function () {
	    	  callback(null, buffer);
	      });
	  });
}