Applies reStructuredText conversion to a string, and returns the
    HTML.
505881
def restructuredtext(text, **kwargs):
    
    from docutils import core
    parts = core.publish_parts(source=text,
                               writer_name='html4css1',
                               **kwargs)
    return parts['fragment']
1090998
def rst2html(rst_src, **kwargs):
    
    pub = rst2pub(rst_src, settings_overrides=kwargs, writer_name='html')
    return pub.writer.parts['body']
590031
def htmlReadDoc(cur, URL, encoding, options):
    
    ret = libxml2mod.htmlReadDoc(cur, URL, encoding, options)
    if ret is None:raise treeError('htmlReadDoc() failed')
    return xmlDoc(_obj=ret)
918189
def parse(self, text):
        
        if self.format == 'markdown':
            try:
                import markdown
            except ImportError:
                raise RuntimeError(u"Looks like markdown is not installed")

            if text.startswith(u'\ufeff'):  # check for unicode BOM
                text = text[1:]

            return markdown.markdown(text, extensions=self.md_extensions)
        elif self.format == 'restructuredtext':
            try:
                from landslide.rst import html_body
            except ImportError:
                raise RuntimeError(u"Looks like docutils are not installed")

            html = html_body(text, input_encoding=self.encoding)

            # RST generates pretty much markup to be removed in our case
            for (pattern, replacement, mode) in self.RST_REPLACEMENTS:
                html = re.sub(re.compile(pattern, mode), replacement, html, 0)

            return html.strip()
        elif self.format == 'textile':
            try:
                import textile
            except ImportError:
                raise RuntimeError(u"Looks like textile is not installed")

            text = text.replace('\n---\n', '\n<hr />\n')

            return textile.textile(text, encoding=self.encoding)
        else:
            raise NotImplementedError(u"Unsupported format %s, cannot parse"
                                      % self.format)
1153636
def to_string(self):
        
        buff = u""
        for child in self.content.iter():
            if child.tag in [self.qn('text:p'), self.qn('text:h')]:
                buff += self.text_to_string(child) + "\n"
        # remove last newline char
        if buff:
            buff = buff[:-1]
        return buff
1269820
def _repr_html_(self):
    
    parts = []
    if self._class:
      parts.append('<div id="hh_%s" class="%s">%s</div>' % (self._id, self._class, self._markup))
    else:
      parts.append('<div id="hh_%s">%s</div>' % (self._id, self._markup))

    if len(self._script) != 0:
      parts.append('<script>')
      parts.append('require([')
      parts.append(','.join(['"%s"' % d[0] for d in self._dependencies]))
      parts.append('], function(')
      parts.append(','.join([d[1] for d in self._dependencies]))
      parts.append(') {')
      parts.append(self._script)
      parts.append('});')
      parts.append('</script>')

    return ''.join(parts)
1166399
def to_document(input, context = {}, result = nil)
      result = call(input, context, result)
      HTML::Pipeline.parse(result[:output])
    end
710320
def _render(self, text):
        ''''''
        parser = commonmark.Parser()
        ast = parser.parse(text)
        renderer = HtmlRenderer(self)
        html = renderer.render(ast)
        return html
1231568
def _get_markup(self, text, is_markdown, **kwargs):
        
        if is_markdown:
            return markdown.to_html(
                text,
                config=kwargs,
                search_path=self.search_path)

        return html_entry.process(
            text,
            config=kwargs,
            search_path=self.search_path)
657762
def to_html(self):
        

        text = self.text
        if text is None:
            text = self.uri
        return '<a href="%s"%s>%s</a>' % (
            self.uri, self.html_attributes(), text)
278316
def html(self) -> str:
        
        if self._owner and self.name in self._owner._special_attr_boolean:
            return self.name
        else:
            value = self.value
            if isinstance(value, str):
                value = html_.escape(value)
            return '{name}="{value}"'.format(name=self.name, value=value)
230699
def _repr_html_(self):
        
        row1 = '<tr><th style="text-align:center;" '
        row1 += 'colspan="2">{}<br><small>{{}}</small></th></tr>'
        rows = row1.format(getattr(self.header, 'name', ''))
        rows = rows.format(getattr(self.header, 'uwi', ''))
        s = '<tr><td><strong>{k}</strong></td><td>{v}</td></tr>'

        if getattr(self, 'location', None) is not None:
            for k, v in self.location.__dict__.items():
                if k in ['deviation', 'position']:
                    continue
                if k == 'crs':
                    v = v.__repr__()
                rows += s.format(k=k, v=v)

        if getattr(self, 'data', None) is not None:
            v = ', '.join(sorted(list(self.data.keys())))
            rows += s.format(k="data", v=v)

        html = '<table>{}</table>'.format(rows)
        return html
812054
def reconstitute(html):
    """"""
    try:
        htree = etree.parse(html)
    except etree.XMLSyntaxError:
        html.seek(0)
        htree = etree.HTML(html.read())

    xhtml = etree.tostring(htree, encoding='utf-8')
    return adapt_single_html(xhtml)
821481
def _repr_html_(self):
        """"""
        out="<table class='taqltable'>\n"

        # Print column name (not if it is auto-generated)
        if not(self.name()[:4]=="Col_"):
            out+="<tr>"
            out+="<th><b>"+self.name()+"</b></th>"
            out+="</tr>"

        cropped=False
        rowcount=0
        colkeywords=self.getkeywords()
        for row in self:
            out +="\n<tr>"
            out += "<td>" + _format_cell(row, colkeywords) + "</td>\n"
            out += "</tr>\n"
            rowcount+=1
            out+="\n"
            if rowcount>=20:
                cropped=True
                break

        if out[-2:]=="\n\n":
            out=out[:-1]

        out+="</table>"

        if cropped:
            out+="<p style='text-align:center'>("+str(self.nrows()-20)+" more rows)</p>\n"

        return out
1085149
public String markdownToHtml(String markdownSource, LinkRenderer linkRenderer) {
        return markdownToHtml(markdownSource.toCharArray(), linkRenderer);
    }
1029842
def html(self, unicode=False):
        
        html = lxml.html.tostring(self.element, encoding=self.encoding)
        if unicode:
            html = html.decode(self.encoding)
        return html
624693
public static String html(String html) {
        StringBuilder sb = createStringBuilder(html.length());
        html(sb, html);
        return sb.toString();
    }