Menu

Tree [516bde] master options/r2 /
 History

HTTPS access


File Date Author Commit
 bin 2016-11-17 Edward d'Auvergne Edward d'Auvergne [516bde] The second argument, if supplied, is now treate...
 .gitignore 2012-09-09 gflanagan gflanagan [66414f] added .gitignore
 .hgignore 2011-06-29 worrp worrp [deef1e] initial
 .hgtags 2011-06-30 worrp worrp [028e61] Added tag 0.2 for changeset daf39519f737
 LICENSE 2011-06-29 worrp worrp [deef1e] initial
 MANIFEST.in 2012-09-09 gflanagan gflanagan [9b1645] include LICENSE in source manifest
 README 2011-06-29 worrp worrp [86b94d] fix encoding issues + README
 html2rest.py 2016-11-17 Edward d'Auvergne Edward d'Auvergne [3aed2b] Addition of the --embedded-uri option to enable...
 pkg 2012-09-09 gflanagan gflanagan [b3b39e] simpler packaging grep
 setup.py 2012-09-09 gflanagan gflanagan [a6edb0] update for release

Read Me

html2rest.py
============

Convert HTML to restructuredText. Very limited, but intended as a "50%" tool, to be
followed by manual editing.

Install
#######

::

    easy_install html2rest

Or::

    pip install html2rest

Usage
#####

From the command line::

    html2rest http://sphinx.pocoo.org/templating.html > templating.rst

Or programmatically::

    from html2rest import html2rest

    stream = StringIO()

    html2rest('<ul><li>one</li><li>two</li></ul>', writer=stream)

Specify input encoding (default is 'utf8') and a preprocessor::

    def strip_chars(html):
        return html.replace('¶', '')
    
    html2rest(html, writer=stream, encoding='latin1', preprocess=strip_chars)

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.