Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Convert HTML to reStructuredText

branch: master

simpler packaging grep

latest commit b3b39e4c99
gflanagan authored September 09, 2012
Octocat-spinner-32 bin fix stdin usage September 07, 2012
Octocat-spinner-32 .gitignore added .gitignore September 09, 2012
Octocat-spinner-32 .hgignore initial June 29, 2011
Octocat-spinner-32 .hgtags Added tag 0.2 for changeset daf39519f737 June 30, 2011
Octocat-spinner-32 LICENSE initial June 29, 2011
Octocat-spinner-32 include LICENSE in source manifest September 09, 2012
Octocat-spinner-32 README fix encoding issues + README June 29, 2011
Octocat-spinner-32 update for release September 09, 2012
Octocat-spinner-32 pkg simpler packaging grep September 09, 2012
Octocat-spinner-32 update for release September 09, 2012

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



    easy_install html2rest


    pip install html2rest


From the command line::

    html2rest > 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)

Something went wrong with that request. Please try again.