render content with "active" urls logic
170787
def render_tag(self, context, caller, **kwargs):
        ''''''
        # load configuration from passed options
        self.load_configuration(**kwargs)

        # get request from context
        request = context['request']

        # get full path from request
        self.full_path = request.get_full_path()

        # render content of extension
        content = caller()

        # check content for "active" urls
        content = render_content(
            content,
            full_path=self.full_path,
            parent_tag=self.parent_tag,
            css_class=self.css_class,
            menu=self.menu,
            ignore_params=self.ignore_params,
        )

        return content
391222
def render_GET(self, request):
    """"""
    fullPath = request.path.split('/')
    if not fullPath[-1]:
      fullPath = fullPath[:-1]
    parts = fullPath[2:]
    statDict = util.lookup(scales.getStats(), parts)

    if statDict is None:
      request.setResponseCode(404)
      return "Path not found."

    if 'query' in request.args:
      query = request.args['query'][0]
    else:
      query = None

    if 'format' in request.args and request.args['format'][0] == 'json':
      request.headers['content-type'] = 'text/javascript; charset=UTF-8'
      formats.jsonFormat(request, statDict, query)
    elif 'format' in request.args and request.args['format'][0] == 'prettyjson':
      request.headers['content-type'] = 'text/javascript; charset=UTF-8'
      formats.jsonFormat(request, statDict, query, pretty=True)
    else:
      formats.htmlHeader(request, '/' + '/'.join(parts), self.serverName, query)
      formats.htmlFormat(request, tuple(parts), statDict, query)

    return ''
5432
def activable_li_tag(*url, &block)
      content_tag :li, capture(&block), :class => ("active" if url.any?{|u| current_page?(u)})
    end
1296660
def main_page(request):
    
    p = get_object_or_404(Page, slug='main', active=True)
    return render(request, p.tpl, get_page_tpl_ctx(p, request))
584767
def _render_content(self, content, **settings):
        
        if isinstance(content, dict):
            return self._render_content_dict(content, 0, [], **settings)
        elif isinstance(content, list):
            return self._render_content_list(content, 0, [], **settings)
        else:
            raise Exception("Received invalid data tree for rendering.")
291887
function renderPageTree(root, renderOpts) {

    renderOpts = u.assign({ openClass:'open' }, renderOpts);

    if (renderOpts.groupBy) {
      var folderPages =
        u.map(u.groupBy(root._children, renderOpts.groupBy), function(children, name) {
          if (name === 'undefined') { name = renderOpts.defaultGroup || ''; }
          return { folderPage: true,
                   _href:      name ? '/' + u.slugify(name) + '/' : '',
                   _children:  children,
                   name:       name };
        });
      return recurse(folderPages);
    }
    else return recurse(root._children);

    function recurse(children, pid) {
      pid = pid || renderOpts.pageTreeID || 'page-tree';
      var out = '\n<ul>';

      u.each(children, function(page) {
        var ppid = (pid + '-' + page._href).replace(/\W+/g, '-').replace(/^-|-$/g,'');
        out += '\n<li' + (page._children ? ' id="' + ppid + '" class="folder"' : '') + '>'
            + (page.folderPage ?
              ((page.name || page._href) ? '<span class="folderPage">' + (page.name || u.unslugify(page._href)) + '</span>' : '') :
              renderLink(u.assign({}, renderOpts, { href:page._href, title:(page.title || page.name) })))
            + (page._children ? recurse(page._children, ppid) : '')
            + '</li>';
      });
      return out + '\n</ul>';
    }
  }
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
466142
def url_combo_activated(self, valid):
        """"""
        text = to_text_string(self.url_combo.currentText())
        self.go_to(self.text_to_url(text))
441295
def render_link(self):
        """"""
        extra_context = {
            'add_nofollow': settings.ADD_NOFOLLOW,
            'page': self,
            'querystring_key': self.querystring_key,
        }
        if self.is_current:
            template_name = 'el_pagination/current_link.html'
        else:
            template_name = 'el_pagination/page_link.html'
            if settings.USE_NEXT_PREVIOUS_LINKS:
                if self.is_previous:
                    template_name = 'el_pagination/previous_link.html'
                if self.is_next:
                    template_name = 'el_pagination/next_link.html'
        if template_name not in _template_cache:
            _template_cache[template_name] = loader.get_template(template_name)
        template = _template_cache[template_name]
        with self.context.push(**extra_context):
            return template.render(self.context.flatten())
166641
def render(self, parsed, page=False, minify=False):
        
        # Create a random ID prefix to make sure parses don't receive the
        # same ID, even if they're identical
        id_prefix = uuid.uuid4().hex
        rendered = []
        for i, p in enumerate(parsed):
            if i == 0:
                settings = p.get("settings", {})
                self.direction = settings.get("direction", DEFAULT_DIR)
                self.lang = settings.get("lang", DEFAULT_LANG)
            render_id = "{}-{}".format(id_prefix, i)
            svg = self.render_svg(render_id, p["words"], p["arcs"])
            rendered.append(svg)
        if page:
            content = "".join([TPL_FIGURE.format(content=svg) for svg in rendered])
            markup = TPL_PAGE.format(
                content=content, lang=self.lang, dir=self.direction
            )
        else:
            markup = "".join(rendered)
        if minify:
            return minify_html(markup)
        return markup
593846
def render
      rendered_items = ''

      list.list_items.each do |list_item|
        rendered_items += render_item(list_item)
      end

      content_tag opts[:wrapper_element], rendered_items, html_options, false
    end
1132994
function renderStream() {
    es.addEventListener('css:processed', function (event) {
      // Inject the CSS
      var style = document.getElementById('jsbin-css');
      if (style.styleSheet) {
        style.styleSheet.cssText = event.data;
      } else {
        style.innerHTML = event.data;
      }
    });

    es.addEventListener('reload', reload);
    // Update the url when the revision is bumped
    es.addEventListener('bump-revision', function (event) {
      window.location.pathname = cleanPath(event.data);
    });
    // Javascript and HTML cause a reload. Would be nice to make it possible to
    // inject HTML changes in future.
    es.addEventListener('javascript:processed', reload);
    es.addEventListener('html:processed', reload);
  }
75309
def render
      content_tag(:ul) do
        html = "\n"

        if show_first_page?
          html += content_tag(:li, :class => "first_page") do
            link_to_page collection.first_page, 'paginate.first_page_label'
          end
          html += "\n"
        end

        if show_previous_page?
          html += content_tag(:li, :class => "previous_page") do
            link_to_page collection.previous_page, 'paginate.previous_page_label'
          end
          html += "\n"
        end

        html += render_pager

        if show_next_page?
          html += content_tag(:li, :class => "next_page") do
            link_to_page collection.next_page, 'paginate.next_page_label'
          end
          html += "\n"
        end

        if show_last_page?
          html += content_tag(:li, :class => "last_page") do
            link_to_page collection.last_page, 'paginate.last_page_label'
          end
          html += "\n"
        end
        html.html_safe
      end
    end
1232817
function renderContent(source, generator, context, options, cb) {
    ejs.renderFile(generator.templatePath(source), context, options, (err, res) => {
        if (!err) {
            cb(res);
        } else {
            generator.error(`Copying template ${source} failed. [${err}]`);
        }
    });
}
311276
def render(self, *args, **kwargs):
        """"""
        # args kwargs API provided for last minute content injection
        # self._reverse_mro_func('pre_render')
        pretty = kwargs.pop("pretty", False)
        if pretty and self._stable != "pretty":
            self._stable = False

        for arg in args:
            self._stable = False
            if isinstance(arg, dict):
                self.inject(arg)
        if kwargs:
            self._stable = False
            self.inject(kwargs)

        # If the tag or his contents are not changed and we already have rendered it
        # with the same attrs we skip all the work
        if self._stable and self._render:
            return self._render

        pretty_pre = pretty_inner = ""
        if pretty:
            pretty_pre = "\n" + ("\t" * self._depth) if pretty else ""
            pretty_inner = "\n" + ("\t" * self._depth) if len(self.childs) > 1 else ""
        inner = self.render_childs(pretty) if not self._void else ""

        # We declare the tag is stable and have an official render:
        tag_data = (
            pretty_pre,
            self._get__tag(),
            self.render_attrs(),
            inner,
            pretty_inner,
            self._get__tag()
        )[: 6 - [0, 3][self._void]]
        self._render = self._template % tag_data
        self._stable = "pretty" if pretty else True
        return self._render
945178
def render(self, context):
        """"""

        content = mark_safe(self.get_content_from_context(context))
        if not content:
            return ''
        if self.parsed:
            try:
                t = template.Template(content, name=self.name)
                content = mark_safe(t.render(context))
            except TemplateSyntaxError as error:
                if global_settings.DEBUG:
                    content = PLACEHOLDER_ERROR % {
                        'name': self.name,
                        'error': error,
                    }
                else:
                    content = ''
        if self.as_varname is None:
            return content
        context[self.as_varname] = content
        return ''
1220787
def render(self, name, value, attrs=None, renderer=None):
        """"""
        location = getattr(value, '_seralized_location', '')
        if location and not hasattr(value, 'url'):
            value.url = '#'
            if hasattr(self, 'get_template_substitution_values'):
                # Django 1.8-1.10
                self.template_with_initial = (
                    '%(initial_text)s: %(initial)s %(clear_template)s'
                    '<br />%(input_text)s: %(input)s')
        attrs = attrs or {}
        attrs.update({'data-upload-url': self.url})
        hidden_name = self.get_hidden_name(name)
        kwargs = {}
        if django_version >= (1, 11):
            kwargs['renderer'] = renderer

        parent = super(StickyUploadWidget, self).render(name, value, attrs=attrs, **kwargs)
        hidden = forms.HiddenInput().render(hidden_name, location, **kwargs)

        return mark_safe(parent + '\n' + hidden)