Renders text nodes with all markings.
178730
def render(node)
      node = Marshal.load(Marshal.dump(node)) # Clone the node

      node.fetch('marks', []).each do |mark|
        renderer = mappings[mark['type']]
        return mappings[nil].new(mappings).render(mark) if renderer.nil? && mappings.key?(nil)
        node['value'] = renderer.new(mappings).render(node) unless renderer.nil?
      end

      node['value']
    end
688499
def render_ents(self, text, spans, title):
        
        markup = ""
        offset = 0
        for span in spans:
            label = span["label"]
            start = span["start"]
            end = span["end"]
            entity = escape_html(text[start:end])
            fragments = text[offset:start].split("\n")
            for i, fragment in enumerate(fragments):
                markup += escape_html(fragment)
                if len(fragments) > 1 and i != len(fragments) - 1:
                    markup += "</br>"
            if self.ents is None or label.upper() in self.ents:
                color = self.colors.get(label.upper(), self.default_color)
                ent_settings = {"label": label, "text": entity, "bg": color}
                if self.direction == "rtl":
                    markup += TPL_ENT_RTL.format(**ent_settings)
                else:
                    markup += TPL_ENT.format(**ent_settings)
            else:
                markup += entity
            offset = end
        markup += escape_html(text[offset:])
        markup = TPL_ENTS.format(content=markup, dir=self.direction)
        if title:
            markup = TPL_TITLE.format(title=title) + markup
        return markup
306410
def _iter_texts(self, tree):
        """"""
        skip = (
            not isinstance(tree, lxml.html.HtmlElement)  # comments, etc.
            or tree.tag in self.skipped_tags
        )
        if not skip:
            if tree.text:
                yield Text(tree.text, tree, 'text')
            for child in tree:
                for text in self._iter_texts(child):
                    yield text
        if tree.tail:
            yield Text(tree.tail, tree, 'tail')
432634
def render( self, tag, single, between, kwargs ):
        """"""

        out = "<%s" % tag
        for key, value in list( kwargs.items( ) ):
            if value is not None:               # when value is None that means stuff like <... checked>
                key = key.strip('_')            # strip this so class_ will mean class, etc.
                if key == 'http_equiv':         # special cases, maybe change _ to - overall?
                    key = 'http-equiv'
                elif key == 'accept_charset':
                    key = 'accept-charset'
                out = "%s %s=\"%s\"" % ( out, key, escape( value ) )
            else:
                out = "%s %s" % ( out, key )
        if between is not None:
            out = "%s>%s</%s>" % ( out, between, tag )
        else:
            if single:
                out = "%s />" % out
            else:
                out = "%s>" % out
        if self.parent is not None:
            self.parent.content.append( out )
        else:
            return out
86009
def process_text(self, node):
        
        text = node.string.strip()
        if not text:
            return

        # Set all the properties
        properties=dict()
        if self.is_bold(node):
            properties['bold'] = True
        if self.is_italic(node):
            properties['italic'] = True
        if self.url(node):
            properties['url'] = self.url(node)
        if self.is_sub(node):
            properties['sub'] = True
        if self.is_super(node):
            properties['super'] = True

        content=[node.string]

        return document.Text(properties, content)
470792
@Override
    public Object render(Map<String, Object> context, LNode... nodes) {
        return nodes[0].render(context);
    }
864678
def render(document)
      document['content'].each_with_object([]) do |node, result|
        result << find_renderer(node).render(node)
      end.join("\n")
    end
578170
def _render(self):
        

        self._last_text = self.shawn_text

        self._surface = self.font.render(self.shawn_text, True, self.color, self.bg_color)
        size = self.w, self._surface.get_height()
        self.size = size
1080062
def draw_tree(node,
              child_iter=lambda n: n.children,
              text_str=str):
    """"""
    return LeftAligned(traverse=Traversal(get_text=text_str,
                                          get_children=child_iter),
                       draw=LegacyStyle())(node)
1349449
def render(self, type, rerender=False):
        """"""
        for child in self.children:
            child.render(type, rerender)
507281
def _render(self):
        

        self._last_text = self.text

        self._surface = self.font.render(self.text, True, self.color, self.bg_color)
        rect = self._surface.get_rect()

        self.size = rect.size
604813
def render(self, parsed):
        
        self.renderer.root_node = parsed
        with self.renderer as r:
            return r.render(parsed)
104417
def draw_text(self, ax, text, force_trans=None, text_type=None):
        """"""
        content = text.get_text()
        if content:
            transform = text.get_transform()
            position = text.get_position()
            coords, position = self.process_transform(transform, ax,
                                                      position,
                                                      force_trans=force_trans)
            style = utils.get_text_style(text)
            self.renderer.draw_text(text=content, position=position,
                                    coordinates=coords,
                                    text_type=text_type,
                                    style=style, mplobj=text)
634670
function renderAll(files, data, outputDir) {

  for (var i = 0; i < files.length; i++) {
    render(files[i], data, outputDir)
  }

}
127508
private void renderTextPath(SVG.TextPath obj)
   {
      debug("TextPath render");

      updateStyleForElement(state, obj);

      if (!display())
         return;
      if (!visible())
         return;

      SVG.SvgObject  ref = obj.document.resolveIRI(obj.href);
      if (ref == null)
      {
         error("TextPath reference '%s' not found", obj.href);
         return;
      }

      SVG.Path     pathObj = (SVG.Path) ref;
      Path         path = (new PathConverter(pathObj.d)).getPath();

      if (pathObj.transform != null)
         path.transform(pathObj.transform);

      PathMeasure  measure = new PathMeasure(path, false);

      float  startOffset = (obj.startOffset != null) ? obj.startOffset.floatValue(this, measure.getLength()) : 0f;

      // Handle text alignment
      Style.TextAnchor  anchor = getAnchorPosition();
      if (anchor != Style.TextAnchor.Start) {
         float  textWidth = calculateTextWidth(obj);
         if (anchor == Style.TextAnchor.Middle) {
            startOffset -= (textWidth / 2);
         } else {
            startOffset -= textWidth;  // 'End' (right justify)
         }
      }

      checkForGradientsAndPatterns((SvgElement) obj.getTextRoot());
      
      boolean  compositing = pushLayer();

      enumerateTextSpans(obj, new PathTextDrawer(path, startOffset, 0f));

      if (compositing)
         popLayer(obj);
   }
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)
860856
def _display(node, indent, expandattrs, expandvals, output):
    """"""
    attrs = _displayattrs(node.attrib, expandattrs)
    if node.text is None or not expandvals:
        val = ''
    elif isinstance(node.text, str):
        val = ' %s' % repr(node.text.strip())
    else:
        val = ' %s' % repr(node.text)  # node.text can be a tuple
    output.write(encode(indent + striptag(node.tag) + attrs + val + '\n'))
    for sub_node in node:
        _display(sub_node, indent + '  ', expandattrs, expandvals, output)