Render complete markup.

        parsed (list): Dependency parses to render.
        page (bool): Render parses wrapped as full HTML page.
        minify (bool): Minify HTML markup.
        RETURNS (unicode): Rendered HTML markup.
180865
def render(self, parsed, page=False, minify=False):
        
        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)
            rendered.append(self.render_ents(p["text"], p["ents"], p.get("title")))
        if page:
            docs = "".join([TPL_FIGURE.format(content=doc) for doc in rendered])
            markup = TPL_PAGE.format(content=docs, lang=self.lang, dir=self.direction)
        else:
            markup = "".join(rendered)
        if minify:
            return minify_html(markup)
        return markup
202244
def render(self, data, accepted_media_type=None, renderer_context=None):
        

        wrapper = None
        success = False

        for wrapper_name in self.wrappers:
            wrapper_method = getattr(self, wrapper_name)
            try:
                wrapper = wrapper_method(data, renderer_context)
            except WrapperNotApplicable:
                pass
            else:
                success = True
                break

        if not success:
            raise WrapperNotApplicable(
                'No acceptable wrappers found for response.',
                data=data, renderer_context=renderer_context)

        renderer_context["indent"] = 4

        return super(JsonApiMixin, self).render(
            data=wrapper,
            accepted_media_type=accepted_media_type,
            renderer_context=renderer_context)
936708
def render_like(parser, token):
    

    tokens = token.split_contents()
    var = tokens[1]

    return LikeRenderer(var)
93122
def render_html(self, request, instance, context):
        
        render_template = self.get_render_template(request, instance, email_format='html')
        if not render_template:
            return str(u"{No HTML rendering defined for class '%s'}" % self.__class__.__name__)

        instance_context = self.get_context(request, instance, email_format='html', parent_context=context)
        instance_context['email_format'] = 'html'

        html = self.render_to_string(request, render_template, instance_context)
        if self.render_replace_context_fields:
            html = replace_fields(html, instance_context)  # pass safe-string
        return html
1083911
function renderDoc(page, renderOpts) {
    if (generator.renderOpts !== defaultRenderOpts) return log(new Error('Recursive call to renderDoc'));
    var rOpts = generator.renderOpts = function() { return u.assign({}, defaultRenderOpts(page), renderOpts); };
    var out = renderTemplate(page, docTemplate(page), rOpts()); // synchronous
    generator.renderOpts = defaultRenderOpts;
    return out;
  }
872060
def on_page_markdown(self, markdown, page, config,
                          site_navigation=None, **kwargs):
        ""

        # the site_navigation argument has been made optional
        # (deleted in post 1.0 mkdocs, but maintained here
        # for backward compatibility)

        if not self.variables:
            return markdown

        else:

            # Create templae and get the variables
            md_template = Template(markdown)

            # Execute the jinja2 template and return
            return md_template.render(**self.variables)
426418
def render_text(text, preformatted=False):
  
  return IPython.core.display.HTML(_html.HtmlBuilder.render_text(text, preformatted))
1311396
def render_full(self, request, lodgeit_url=None):
        """"""
        static_path = request.app.router[STATIC_ROUTE_NAME].url_for(
            filename='')
        root_path = request.app.router[ROOT_ROUTE_NAME].url_for()
        exc = escape(self.exception)
        summary = self.render_summary(request.app, include_title=False)
        token = request.app[APP_KEY]['pdtb_token']
        qs = {'token': token, 'tb': str(self.id)}

        url = request.app.router[EXC_ROUTE_NAME].url_for().with_query(qs)
        evalex = request.app[APP_KEY]['exc_history'].eval_exc

        vars = {
            'evalex': evalex and 'true' or 'false',
            'console': 'false',
            'lodgeit_url': escape(lodgeit_url),
            'title': exc,
            'exception': exc,
            'exception_type': escape(self.exception_type),
            'summary': summary,
            'plaintext': self.plaintext,
            'plaintext_cs': re.sub('-{2,}', '-', self.plaintext),
            'traceback_id': self.id,
            'static_path': static_path,
            'token': token,
            'root_path': root_path,
            'url': url,
        }
        return render('exception.jinja2', request.app, vars, request=request)
227210
def render_html_tree(tree):
    

    # Restore any tag names that were changed in get_html_tree()
    for el in tree.iter():
        if '__tag_name' in el.attrib:
            actual_tag_name = el.attrib.pop('__tag_name')
            el.tag = actual_tag_name

    html = lxml.html.tostring(tree, encoding='utf8').decode('utf8')

    return strip_wrapping(html)
1175161
def parse(html):
    
    if not html:
        return html, []

    parser = HTMLToTelegramParser()
    parser.feed(_add_surrogate(html))
    text = helpers.strip_text(parser.text, parser.entities)
    return _del_surrogate(text), parser.entities
1186859
def to_html(options = :DEFAULT, extensions = [])
      opts = Config.process_options(options, :render)
      _render_html(opts, extensions).force_encoding('utf-8')
    end
770509
def transform(request, syntax_processor_name=None, var_name="text"):
    
    if request.method != 'POST':
        return HttpResponseNotAllowed("Only POST allowed")

    source = request.POST.get(var_name)
    if not source:
        return HttpResponse('')

    processor = TextProcessor.objects.get(name=syntax_processor_name or getattr(settings, "DEFAULT_MARKUP", "markdown"))
    output = processor.convert(source)

    try:
        t = template.Template(output, name='markup_preview')
        output = t.render(template.Context({'MEDIA_URL' : settings.MEDIA_URL}))
    except template.TemplateSyntaxError, e:
        log.warning('Error in preview rendering: %s' % e)
        output = '<h3 style="color:red">%s</h3><p>%s</p>' % (ugettext('You have an errors in source text!'), e)

    return HttpResponse(output)
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
1013916
def render(self, text, auth=None):
        
        if markdown is None:
            import markdown
        if UrlizeExtension is None:
            from .mdx_urlize import UrlizeExtension
        return markdown.markdown(text, extensions=[
            'fenced_code',
            'codehilite(css_class=highlight)',
            'toc',
            'tables',
            'sane_lists',
            UrlizeExtension(),
        ])
335727
def render(self, context):
        
        with self.merge_translation(context):
            django_translated = self.do_translate.render(context)

        return django_translated
935287
def html(self, page, version=None):
        
        return (self._dokuwiki.send('wiki.getPageHTMLVersion', page, version)
                if version is not None
                else self._dokuwiki.send('wiki.getPageHTML', page))
1236370
def _render_text(self, text, preformatted=False):
    
    tag = 'pre' if preformatted else 'div'
    self._segments.append('<%s>%s</%s>' % (tag, HtmlBuilder._format(text), tag))