Convert a package's long description to HTML.
177758
def render_long_description(self, dirname):
        
        with changedir(dirname):
            self.setuptools.check_valid_package()
            long_description = self.setuptools.get_long_description()
            outfile = abspath('.long-description.html')
            self.docutils.publish_string(long_description, outfile, self.styles)
            return outfile
1306988
def markup_description(description):
    
    if apply_markdown:
        description = apply_markdown(description)
    else:
        description = escape(description).replace('\n', '<br />')
        description = '<p>' + description + '</p>'
    return mark_safe(description)
1006553
def long_description(*filenames):
    """"""
    res = ['']
    for filename in filenames:
        with open(filename) as fp:
            for line in fp:
                res.append('   ' + line)
            res.append('')
        res.append('\n')
    return EMPTYSTRING.join(res)
843045
def to_html(self):
        '''
        

        '''
        javascript_to_insert = '\n'.join([
            PackedDataUtils.full_content_of_javascript_files(),
            self.category_scatterplot_structure._visualization_data.to_javascript('getCategoryDataAndInfo'),
            self.category_scatterplot_structure.get_js_to_call_build_scatterplot(self.category_plot_interface),
            self.term_scatterplot_structure._visualization_data.to_javascript('getTermDataAndInfo'),
            self.term_scatterplot_structure.get_js_to_call_build_scatterplot(self.term_plot_interface),
        ])
        html_template = self._get_html_template()
        html_content = (
            html_template
                .replace('<!-- INSERT SCRIPT -->', javascript_to_insert, 1)
                .replace('<!--D3URL-->', self.d3_url_struct.get_d3_url(), 1)
                .replace('<!--D3SCALECHROMATIC-->', self.d3_url_struct.get_d3_scale_chromatic_url())
            # .replace('<!-- INSERT D3 -->', self._get_packaged_file_content('d3.min.js'), 1)
        )
        html_content = (html_content.replace('http://', self.protocol + '://'))
        if self.show_halo:
            axes_labels = self.category_projection.get_nearest_terms(
                num_terms=self.num_terms
            )
            for position, terms in axes_labels.items():
                html_content = html_content.replace('{%s}' % position, self._get_lexicon_html(terms))
        return html_content.replace('{width}', str(self.category_width)).replace('{height}', str(self.category_height))
305331
def _repr_html_(self, **kwargs):
        """"""
        from jinja2 import Template
        from markdown import markdown as convert_markdown

        extensions = [
            'markdown.extensions.extra',
            'markdown.extensions.admonition'
        ]

        return convert_markdown(self.markdown, extensions)
1087284
def _get_long_description(self):
        

        if self.description is None:
            return None

        lines = [x for x in self.description.split('\n')]
        if len(lines) == 1:
            return None

        elif len(lines) >= 3 and lines[1] == '':
            return '\n'.join(lines[2:])

        return self.description
623041
def ast_to_html(self, ast, link_resolver):
        
        out, _ = cmark.ast_to_html(ast, link_resolver)
        return out
518917
def get_long_description():
    

    with open(
        os.path.join(BASE_DIRECTORY, 'README.md'),
        'r',
        encoding='utf-8'
    ) as readme_file:
        return readme_file.read()
861714
def DocToHelp(doc):
  """"""

  # Get rid of starting and ending white space. Using lstrip() or even
  # strip() could drop more than maximum of first line and right space
  # of last line.
  doc = doc.strip()

  # Get rid of all empty lines.
  whitespace_only_line = re.compile('^[ \t]+$', re.M)
  doc = whitespace_only_line.sub('', doc)

  # Cut out common space at line beginnings.
  doc = pep257.trim(doc)

  # Just like this module's comment, comments tend to be aligned somehow.
  # In other words they all start with the same amount of white space.
  # 1) keep double new lines;
  # 2) keep ws after new lines if not empty line;
  # 3) all other new lines shall be changed to a space;
  # Solution: Match new lines between non white space and replace with space.
  doc = re.sub(r'(?<=\S)\n(?=\S)', ' ', doc, flags=re.M)

  return doc
193051
def to_html(self):
        
        if self.items is None:
            return
        else:
            html = '<ol%s>\n' % self.html_attributes()
            for item in self.items:
                html += '<li>%s</li>\n' % item.to_html()
            html += '</ol>'
            return html
1277340
def htmlFromThing(thing,title):
    """"""
    try:
        thing2 = copy.copy(thing)
    except:
        print("crashed copying the thing! I can't document it.")
        return False
    stuff=analyzeThing(thing2)
    names2=list(stuff.keys())
    for i,name in enumerate(names2):
        if name.startswith("_"):
            names2[i]="zzzzzzzzzz"+name

    html="""<html><head><style>
    body {font-family: courier, monospace;}
    .name {font-weight: bold;}
    .type {font-style: italic; font-family: serif; color: #AAA;}
    .desc {}
    .itemEval {background-color: #DDFFDD;}
    .itemEvalFail {}
    table {font-size: .8em;
           margin-top: 20px;
           border-collapse: collapse;}
    tr {border: 1px solid #CCC; vertical-align: text-top;}
    td {padding: 2px 10px 2px 10px;}
    .credits {text-align: center;
              opacity: 0.5;
              margin-top: 50px;
              font-size: .8em;
              font-family: sans-serif;}
    </style></head><body>"""

    if title:
        html+='<span style="color: #CCC;">title: </span>%s<br>'%title
    textTitle=""
    textType=""
    try:
        textTitle=websafe(str(thing))
        textType=websafe(type(thing).__name__)
    except:
        pass
    html+='<span style="color: #CCC;">value: </span>%s<br>'%textTitle
    html+='<span style="color: #CCC;">&nbsp;type: </span>%s<br>'%textType
    html+='<table cellpadding=3 align="center">'
    html+='<tr style="background-color: #000; color: #FFF; font-weight: bold;">'
    html+='<td>property</td><td>type</td><td>value</td>'
    html+='<td>evaluated (without arguments)</td></tr>'
    for name in sorted(names2):
        if name.startswith("zzzzzzzzzz"):
            name=name[10:]
        itemName=str(name)
        itemType=websafe(stuff[name][0])
        itemStr=websafe(stuff[name][1])
        itemEval=websafe(stuff[name][2])
        color="DDDDFF"
        color2=""
        if "method" in itemType:
            itemName+="()"
            color="FFDDDD"
        if itemName.startswith("_"):
            color="EEEEEE"
        if itemStr.startswith("&lt;") and not ", " in itemStr:
            itemStr="""<span style="color: #CCC; font-family: serif;
                font-style: italic;">%s</span>"""%itemStr
        else:
            color2="DDFFDD"
            if itemEval=="":
                itemEval="FAILED TO EVALUATE"
        html+='<tr>'
        html+='<td class="name" style="background-color: #%s;">%s</td>'%(color,itemName)
        html+='<td class="type">%s</td>'%(itemType)
        html+='<td class="itemStr" style="background-color: #%s;">%s</td>'%(color2,itemStr)
        if itemEval=="FAILED TO EVALUATE":
            html+='<td class="itemEvalFail"></td>'
        else:
            html+='<td class="itemEval">%s</td>'%(itemEval)
        html+='</tr>'

    dt=datetime.datetime.now()
    html+="""</table><p class="credits">
    page automatically generated by
    <a href="https://pypi.python.org/pypi/webinspect/">webinspect</a>
    (version %s) %s</p>
    </body></html>"""%(__version__,dt.strftime("at %I:%M %p on %B %d, %Y"))

    return html
543801
def abstract_html(self):
        """"""
        descriptions = _pluralize(self._r['descriptions'], 'description')
        for desc in descriptions:
            if desc['@descriptionType'] == 'Abstract':
                return desc['#text']
907618
def to_html(self, show_mean=None, sortable=None, colorize=True, *args,
                **kwargs):
        """"""
        if show_mean is None:
            show_mean = self.show_mean
        if sortable is None:
            sortable = self.sortable
        df = self.copy()
        if show_mean:
            df.insert(0, 'Mean', None)
            df.loc[:, 'Mean'] = ['%.3f' % self[m].mean() for m in self.models]
        html = df.to_html(*args, **kwargs)  # Pandas method
        html, table_id = self.annotate(df, html, show_mean, colorize)
        if sortable:
            self.dynamify(table_id)
        return html
705109
def get_long_description():
    """"""
    with open("README.rst", "r") as f:
        readme = f.read()
    with open("CHANGELOG.rst", "r") as f:
        changelog = f.read()
        changelog = changelog.replace("\nUnreleased\n------------------", "")
    return "\n".join([readme, changelog])
940221
def to_html(self):
        
        if self.text is None:
            return
        else:
            return '<p%s>%s%s</p>' % (
                self.html_attributes(), self.html_icon(), self.text.to_html())
869443
def as_html(self, max_rows=0):
        """"""
        if not max_rows or max_rows > self.num_rows:
            max_rows = self.num_rows
        omitted = max(0, self.num_rows - max_rows)
        labels = self.labels
        lines = [
            (0, '<table border="1" class="dataframe">'),
            (1, '<thead>'),
            (2, '<tr>'),
            (3, ' '.join('<th>' + label + '</th>' for label in labels)),
            (2, '</tr>'),
            (1, '</thead>'),
            (1, '<tbody>'),
        ]
        fmts = self._get_column_formatters(max_rows, True)
        for row in itertools.islice(self.rows, max_rows):
            lines += [
                (2, '<tr>'),
                (3, ' '.join('<td>' + fmt(v, label=False) + '</td>' for
                    v, fmt in zip(row, fmts))),
                (2, '</tr>'),
            ]
        lines.append((1, '</tbody>'))
        lines.append((0, '</table>'))
        if omitted:
            lines.append((0, '<p>... ({} rows omitted)</p>'.format(omitted)))
        return '\n'.join(4 * indent * ' ' + text for indent, text in lines)
974097
def to_classic_html
      buf  = ""
      buf << "<div class='slide "
      buf << classes    if classes
      buf << "'>\n"
      buf << content
      buf << "</div>\n"
      buf
    end