Render compiled HTML
342821
public function render()
    {
        $args = func_get_args();

        foreach ($args as $arg) {
            if(isset($this->output[$arg])) {
                return $this->output[$arg];
            }

            throw new Exception("{$arg} is not set!", 1);
        }
    }
892808
public static function render() {
		$loaded_classes = \Application::get(['application', 'loaded_classes']);
		self::$data['session'] = [];
		if (!empty($_SESSION)) {
			self::$data['session'] = [$_SESSION];
		}
		$application = \Application::get();
		$result = '<div class="container" dir="ltr">';
			$result.= '<table cellpadding="2" cellspacing="2" width="100%">';
				$result.= '<tr>';
					$result.= '<td>';
						$result.= '<table width="100%" class="numbers_debug_links">';
							$result.= '<tr>';
								$result.= '<td nowrap>&nbsp;' . \HTML::a(['value' => 'Hide All', 'href' => 'javascript:void(0);', 'onclick' => "$('.debuging_toolbar_class').hide();"]) . '&nbsp;</td>';
								foreach (self::$data as $k => $v) {
									if ($k == 'errors') {
										$count = count(\Object\Error\Base::$errors);
									} else if ($k == 'classes') {
										$count = count($loaded_classes);
									} else if ($k == 'application') {
										$count = count($application);
									} else if ($k == 'phpinfo') {
										$count = 1;
									} else {
										$count = count($v);
									}
									$result.= '<td nowrap>&nbsp;' . \HTML::a(['value' => ucwords($k) . ' (' . $count . ')', 'id' => "debuging_toolbar_{$k}_a", 'href' => 'javascript:void(0);', 'onclick' => "$('#debuging_toolbar_{$k}').toggle();"]) . '&nbsp;</td>';
								}
								$result.= '<td width="50%" align="right">' . \HTML::a(['href' => '/Numbers/Backend/System/Modules/Controller/DevPortal', 'value' => 'Dev. Portal']) . '</td>';
							$result.= '</tr>';
						$result.= '</table>';
					$result.= '</td>';
				$result.= '</tr>';
				
				// errors
				$result.= '<tr id="debuging_toolbar_errors" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Errors (' . count(\Object\Error\Base::$errors) . ')</h3>';
						$result.= '<table border="1" cellpadding="2" cellspacing="2" width="100%">';
							foreach (\Object\Error\Base::$errors as $k => $v) {
								$result.= '<tr>';
									$result.= '<td><b>' . \Object\Error\Base::$error_codes[$v['errno']] . ' (' . $v['errno'] . ') - ' . implode('<br/>', $v['error']) . '</b></td>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<td>File: ' . $v['file'] . ', Line: ' . $v['line'] . '</td>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<td><pre>' . $v['code'] . '</pre></td>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<td><pre>' . implode("\n", $v['backtrace']) . '</pre></td>';
								$result.= '</tr>';
							}
						$result.= '</table>';
					$result.= '</td>';
				$result.= '</tr>';

				// suppressed
				$result.= '<tr id="debuging_toolbar_suppressed" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Suppressed (' . count(self::$data['suppressed']) . ')</h3>';
						$result.= '<table border="1" cellpadding="2" cellspacing="2" width="100%">';
							foreach (self::$data['suppressed'] as $k => $v) {
								$result.= '<tr>';
									$result.= '<td><b>' . \Object\Error\Base::$error_codes[$v['errno']] . ' (' . $v['errno'] . ') - ' . implode('<br/>', $v['error']) . '</b></td>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<td>File: ' . $v['file'] . ', Line: ' . $v['line'] . '</td>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<td><pre>' . $v['code'] . '</pre></td>';
								$result.= '</tr>';
							}
						$result.= '</table>';
					$result.= '</td>';
				$result.= '</tr>';

				// javascript
				$result.= '<tr id="debuging_toolbar_js" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Javascript Errors (' . count(self::$data['js']) . ')</h3>';
						$result.= '<table border="1" cellpadding="2" cellspacing="2" width="100%">';
							foreach (self::$data['js'] as $k => $v) {
								$result.= '<tr>';
									$result.= '<td><b>' . implode('<br/>', $v['error']) . '</b></td>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<td>File: ' . $v['file'] . ', Line: ' . $v['line'] . '</td>';
								$result.= '</tr>';
							}
						$result.= '</table>';
						$result.= '<div id="debuging_toolbar_js_data">';
							$result.= '&nbsp;';
						$result.= '</div>';
					$result.= '</td>';
				$result.= '</tr>';

				// benchmark
				$result.= '<tr id="debuging_toolbar_benchmark" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Benchmark (' . count(self::$data['benchmark']) . ')' . '</h3>';
						$result.= '<table border="1" cellpadding="2" cellspacing="2" width="100%">';
							$result.= '<tr>';
								$result.= '<th>Name</th>';
								$result.= '<th>Time</th>';
								$result.= '<th>Start</th>';
								$result.= '<th>Total</th>';
								$result.= '<th>Memory</th>';
							$result.= '</tr>';
							foreach (self::$data['benchmark'] as $k => $v) {
								$result.= '<tr>';
									$result.= '<td>' . $v['name'] . '</td>';
									$result.= '<td align="right">' . $v['time'] . '</td>';
									$result.= '<td align="right">' . $v['start'] . '</td>';
									$result.= '<td align="right">' . $v['total'] . '</td>';
									$result.= '<td align="right">' . Format::memory($v['memory'], 'm') . '</td>';
								$result.= '</tr>';
							}
						$result.= '</table>';
					$result.= '</td>';
				$result.= '</tr>';

				// sql
				$result.= '<tr id="debuging_toolbar_sql" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Sql (' . count(self::$data['sql']) . ')' . '</h3>';
						$result.= '<table border="1" cellpadding="2" cellspacing="2" width="100%">';
							foreach (self::$data['sql'] as $k => $v) {
								$temp = is_array($v['key']) ? implode('<br/>', $v['key']) : $v['key'];
								// header first
								$result.= '<tr>';
									$result.= '<th colspan="4" style="color: red;">Sql</th>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<td valign="top" colspan="4"><pre style="width: 1130px;">' . $v['sql'] . '</pre></td>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<th>Error</th>';
									$result.= '<th>Errno</th>';
									$result.= '<th>Num Rows</th>';
									$result.= '<th>Affected Rows</th>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<td valign="top">' . implode('<br/>', $v['error']) . ' - ' . implode('<br/>', $v['error_original'] ?? []) . '</td>';
									$result.= '<td valign="top">' . $v['errno'] . '</td>';
									$result.= '<td valign="top">' . $v['num_rows'] . '</td>';
									$result.= '<td valign="top">' . $v['affected_rows'] . '</td>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<th>Key</th>';
									$result.= '<th>Structure</th>';
									$result.= '<th>Cache</th>';
									$result.= '<th>Time</th>';
								$result.= '</tr>';
								$result.= '<tr>';
									$result.= '<td valign="top">' . $temp . '</td>';
									$result.= '<td valign="top">' . \HTML::table(['options' => $v['structure']]) . '</td>';
									$result.= '<td valign="top">' . (!empty($v['cache']) ? 'Yes' : 'No Cache') . '</td>';
									$result.= '<td valign="top">' . $v['time'] . '</td>';
								$result.= '</tr>';
								// cache tags
								if (!empty($v['cache_tags'])) {
									$result.= '<tr>';
										$result.= '<th>Cache Tags</th>';
										$result.= '<td valign="top" colspan="7" style="max-width: 1000px; overflow: scroll;">' . nl2br(implode("\n", $v['cache_tags']), true) . '</td>';
									$result.= '</tr>';
								}
								// results second
								if (!empty($v['rows'])) {
									$temp2 = current($v['rows']);
									if (!is_array($temp2)) {
										$result.= '<tr>';
												$result.= '<td valign="top" colspan="8" style="max-width: 1000px; overflow: scroll;">' . print_r2($v['rows'], '', true) . '</td>';
											$result.= '</tr>';
									} else {
										$temp = array_keys($temp2);
										$header = array_combine($temp, $temp);
										if (!empty($header)) {
											$result.= '<tr>';
												$result.= '<td valign="top" colspan="8" style="max-width: 1000px; overflow: scroll;">' . \HTML::table(['header' => $header, 'options' => $v['rows']]) . '</td>';
											$result.= '</tr>';
										}
									}
								}
								// backtrace
								if (!empty($v['backtrace'])) {
									$result.= '<tr>';
										$result.= '<td valign="top" colspan="4"><pre style="width: 1130px;">' . strip_tags($v['backtrace']) . '</pre></td>';
									$result.= '</tr>';
								}
								// empty separator
								$result.= '<tr>';
									$result.= '<td valign="top" colspan="4">&nbsp;</td>';
								$result.= '</tr>';
							}
						$result.= '</table>';
					$result.= '</td>';
				$result.= '</tr>';

				// cache
				$result.= '<tr id="debuging_toolbar_cache" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Cache (' . count(self::$data['cache']) . ')' . '</h3>';
						$result.= '<table border="1" cellpadding="2" cellspacing="2" width="100%">';
							$result.= '<tr>';
								$result.= '<th>Type</th>';
								$result.= '<th>Link</th>';
								$result.= '<th>Cache #</th>';
								$result.= '<th>Has Data</th>';
							$result.= '</tr>';
							foreach (self::$data['cache'] as $k => $v) {
								$result.= '<tr>';
									$result.= '<td valign="top">' . $v['type'] . '</td>';
									$result.= '<td valign="top">' . $v['link'] . '</td>';
									$result.= '<td valign="top">' . $v['cache_id'] . '</td>';
									$result.= '<td valign="top">' . ($v['have_data'] ? 'Yes' : 'No') . '</td>';
								$result.= '</tr>';
							}
						$result.= '</table>';
					$result.= '</td>';
				$result.= '</tr>';

				// dump
				$result.= '<tr id="debuging_toolbar_dump" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Dump (' . count(self::$data['dump']) . ')' . '</h3>';
						$result.= '<table border="1" cellpadding="2" cellspacing="2" width="100%">';
							$result.= '<tr>';
								$result.= '<th>Name</th>';
								$result.= '<th>Dump</th>';
							$result.= '</tr>';
							foreach (self::$data['dump'] as $k => $v) {
								$result.= '<tr>';
									$result.= '<td valign="top">' . $v['name'] . '</td>';
									$result.= '<td valign="top"><pre>' . print_r($v['value'], true) . '</pre></td>';
								$result.= '</tr>';
							}
						$result.= '</table>';
					$result.= '</td>';
				$result.= '</tr>';

				// input
				$result.= '<tr id="debuging_toolbar_input" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Input (' . count(self::$data['input']) . ')' . '</h3>';
						$result.= '<table border="1" cellpadding="2" cellspacing="2" width="100%">';
							$result.= '<tr>';
								$result.= '<th>Input</th>';
							$result.= '</tr>';
							foreach (self::$data['input'] as $k => $v) {
								$result.= '<tr>';
									$result.= '<td valign="top"><pre>' . print_r($v, true) . '</pre></td>';
								$result.= '</tr>';
							}
						$result.= '</table>';
					$result.= '</td>';
				$result.= '</tr>';

				// session
				$result.= '<tr id="debuging_toolbar_session" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Session (' . count(self::$data['session']) . ')' . '</h3>';
						$result.= '<table border="1" cellpadding="2" cellspacing="2" width="100%">';
							$result.= '<tr>';
								$result.= '<th>Session</th>';
							$result.= '</tr>';
							foreach (self::$data['session'] as $k => $v) {
								$result.= '<tr>';
									$result.= '<td valign="top"><pre>' . print_r($v, true) . '</pre></td>';
								$result.= '</tr>';
							}
						$result.= '</table>';
					$result.= '</td>';
				$result.= '</tr>';

				// autoloaded classes
				$result.= '<tr id="debuging_toolbar_classes" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Loaded Classes (' . count($loaded_classes) . ')</h3>';
						$result.= '<table border="1" cellpadding="2" cellspacing="2" width="100%">';
							$result.= '<tr>';
								$result.= '<th>Class Name</th>';
								$result.= '<th>File</th>';
								$result.= '<th>Media</th>';
							$result.= '</tr>';
							foreach ($loaded_classes as $k => $v) {
								$result.= '<tr>';
									$result.= '<td><b>' . $v['class'] . '</b></td>';
									$result.= '<td>' . $v['file'] . '</td>';
									$result.= '<td>' . \HTML::table(['options' => $v['media']]) . '</td>';
								$result.= '</tr>';
							}
						$result.= '</table>';
					$result.= '</td>';
				$result.= '</tr>';

				// application
				$result.= '<tr id="debuging_toolbar_application" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Application (' . count($application) . ')</h3>';
						$result.= print_r2($application, 'Application Variables:', true);
					$result.= '</td>';
				$result.= '</tr>';

				// phpinfo
				$result.= '<tr id="debuging_toolbar_phpinfo" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>PHPInfo</h3>';
						\Helper\Ob::start();
						phpinfo();
						$str = \Helper\Ob::clean();
						$str = preg_replace( '%^.*<body>(.*)</body>.*$%ms', '$1', $str);
						$str.= <<<TTT
							<style type="text/css">
								#phpinfo table {
									border: 1px solid #000;
								}
								#phpinfo table tr {
									border-bottom: 1px solid #000;
								}
							</style>
TTT;
						$result.= '<div id="phpinfo">' . $str . '</div>';
					$result.= '</td>';
				$result.= '</tr>';

				// acls
				$result.= '<tr id="debuging_toolbar_acls" class="debuging_toolbar_class" style="display: none;">';
					$result.= '<td>';
						$result.= '<h3>Acls (' . count(\Debug::$data['acls']) . ')</h3>';
						$result.= print_r2(\Debug::$data['acls'], 'Acls', true);
					$result.= '</td>';
				$result.= '</tr>';

			$result.= '</table>';
		$result.= '</div>';
		return $result;
	}
601786
def render
    content = output_capture(@block) do
      instance_exec( *@args, &@block )
    end
    content_wrapped = output_capture() { wrap( content ) }
    output_concat content_wrapped
  end
400744
def render(self, context):
        """"""
        import markdown
        content = self.get_content_from_context(context)
        return markdown.markdown(content)
1091105
def render(self, mark_lib=True):
        """"""
        return FRAME_HTML % {
            "id": self.id,
            "filename": escape(self.filename),
            "lineno": self.lineno,
            "function_name": escape(self.function_name),
            "lines": self.render_line_context(),
            "library": "library" if mark_lib and self.is_library else "",
        }
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('"', "'"))
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)
923298
def render_as_html(self, full=False):
        """"""
        from jinja2.debugrenderer import render_traceback
        return u'%s\n\n<!--\n%s\n-->' % (
            render_traceback(self, full=full),
            self.render_as_text().decode('utf-8', 'replace')
        )
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;
}
601720
def render(self, **context):
		
		# Make the complete context we'll use.
		localns = self.envs.copy()
		localns.update(context)

		try:
			exec(str(self.code), None, localns)
			return localns[Liquid.COMPLIED_RENDERED_STR]
		except Exception:
			stacks = list(reversed(traceback.format_exc().splitlines()))
			for stack in stacks:
				stack = stack.strip()
				if stack.startswith('File "<string>"'):
					lineno = int(stack.split(', ')[1].split()[-1])
					source = []
					if 'NameError:' in stacks[0]:
						source.append('Do you forget to provide the data?')

					import math
					source.append('\nCompiled source (use debug mode to see full source):')
					source.append('---------------------------------------------------')
					nlines = len(self.code.codes)
					nbit   = int(math.log(nlines, 10)) + 3
					for i, line in enumerate(self.code.codes):
						if i - 7 > lineno or i + 9 < lineno: continue
						if i + 1 != lineno:
							source.append('  ' + (str(i+1) + '.').ljust(nbit) + str(line).rstrip())
						else:
							source.append('* ' + (str(i+1) + '.').ljust(nbit) + str(line).rstrip())

					raise LiquidRenderError(
						stacks[0], 
						repr(self.code.codes[lineno - 1]) + 
						'\n' + '\n'.join(source) + 
						'\n\nPREVIOUS EXCEPTION:\n------------------\n' + 
						'\n'.join(stacks) + '\n' +
						'\nCONTEXT:\n------------------\n' +
						'\n'.join(
							'  ' + key + ': ' + str(val) 
							for key, val in localns.items() if not key.startswith('_liquid_') and not key.startswith('__')
						) + '\n'
					)
			raise
343837
function compile(template) {
        Mustache.parse(template);
        return function (view, partials) {
          return Mustache.render(template, view, partials);
        };
      }
1285218
def render(filename, obj):
    """"""
    template_path = abspath(filename)
    env = jinja_env(template_path)
    template_base = os.path.basename(template_path)
    try:
        parsed_content = env.parse(env
                                   .loader
                                   .get_source(env, template_base))
        template_vars = meta.find_undeclared_variables(parsed_content)
        if template_vars:
            missing_vars(template_vars, parsed_content, obj)

        LOG.debug("rendering %s with %s vars",
                  template_path, len(template_vars))
        return env \
            .get_template(template_base) \
            .render(**obj)
    except jinja2.exceptions.TemplateSyntaxError as exception:
        template_trace = traceback.format_tb(sys.exc_info()[2])
        # Different error context depending on whether it is the
        # pre-render variable scan or not
        if exception.filename:
            template_line = template_trace[len(template_trace) - 1]
            raise aomi_excep.Validation("Bad template %s %s" %
                                        (template_line,
                                         str(exception)))

        template_str = ''
        if isinstance(exception.source, tuple):
            # PyLint seems confused about whether or not this is a tuple
            # pylint: disable=locally-disabled, unsubscriptable-object
            template_str = "Embedded Template\n%s" % exception.source[0]

        raise aomi_excep.Validation("Bad template %s" % str(exception),
                                    source=template_str)

    except jinja2.exceptions.UndefinedError as exception:
        template_traces = [x.strip()
                           for x in traceback.format_tb(sys.exc_info()[2])
                           if 'template code' in x]
        raise aomi_excep.Validation("Missing template variable %s" %
                                    ' '.join(template_traces))
1044200
def render(self, name, value, attrs=None, renderer=None):
        
        output = [super(TagAutoComplete, self).render(name, value, attrs)]
        output.append('<script type="text/javascript">')
        output.append('(function($) {')
        output.append('  $(document).ready(function() {')
        output.append('    $("#id_%s").select2({' % name)
        output.append('       width: "element",')
        output.append('       maximumInputLength: 50,')
        output.append('       tokenSeparators: [",", " "],')
        output.append('       tags: %s' % json.dumps(self.get_tags()))
        output.append('     });')
        output.append('    });')
        output.append('}(django.jQuery));')
        output.append('</script>')
        return mark_safe('\n'.join(output))
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()
228884
def pretty_render(data, format='text', indent=0):
    
    if format == 'json':
        return render_json(data)
    elif format == 'html':
        return render_html(data)
    elif format == 'xml':
        return render_xml(data)
    else:
        return dict_to_plaintext(data, indent=indent)
124123
function render(renderProperties, encodings, options) {
	encodings = linearizeEncodings(encodings);

	for (var i = 0; i < encodings.length; i++) {
		encodings[i].options = merge(options, encodings[i].options);
		fixOptions(encodings[i].options);
	}

	fixOptions(options);

	var Renderer = renderProperties.renderer;
	var renderer = new Renderer(renderProperties.element, encodings, options);
	renderer.render();

	if (renderProperties.afterRender) {
		renderProperties.afterRender();
	}
}
263283
def _render_html(self, libraries):
        """"""

        title = self.options.get("title", "Keyword Documentation")
        date = time.strftime("%A %B %d, %I:%M %p")
        cci_version = cumulusci.__version__

        stylesheet_path = os.path.join(os.path.dirname(__file__), "stylesheet.css")
        with open(stylesheet_path) as f:
            stylesheet = f.read()

        jinjaenv = jinja2.Environment(
            loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), autoescape=False
        )
        jinjaenv.filters["robot_html"] = robot.utils.html_format
        template = jinjaenv.get_template("template.html")
        return template.render(
            libraries=libraries,
            title=title,
            cci_version=cci_version,
            stylesheet=stylesheet,
            date=date,
        )