Skip to main content

Convert reStructuredText to plain text

Project description

PyPi Status Build Status

reStructuredText is pretty-damn consumable in its raw form, but extensive use of directives and roles can hamper things or leave the document incomplete in its raw form (cough, .. include, cough).

rst2txt allows you to work around this by evaluating the reStructuredText source and stripping it of most of its formatting. The end result is a document that’s more readable and has elements that don’t make sense in a plain text document, such as images, stripped.

rst2txt is based on the sphinx.writer.text.TextWriter writer used by Sphinx’s TextBuilder but with the Sphinx-specific features stripped out.

Installation

rst2txt is available on PyPI. To install, run:

$ pip install --user rst2txt

Usage

Most users will want just the rst2txt application:

$ rst2txt README.rst

It is also possible to call this programmatically though. This can be useful for things like consuming README files:

from docutils.core import publish_file
import rst2txt

with open('README.rst', 'r') as source:
    publish_file(source=source, destination_path='README.txt',
                 writer=rst2txt.Writer())

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rst2txt-1.0.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rst2txt-1.0.0-py2.py3-none-any.whl (12.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file rst2txt-1.0.0.tar.gz.

File metadata

  • Download URL: rst2txt-1.0.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for rst2txt-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fbfd1f03c9804e7ce76d6e3ccaef1649788f275ecd7b682cf9c99b75e84177ab
MD5 d61ac55ff689b0ef5099571f08aff647
BLAKE2b-256 4378ba28a0121bb134add314d36f4f6686c6e9e4747f15792affea77621446f3

See more details on using hashes here.

File details

Details for the file rst2txt-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: rst2txt-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for rst2txt-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 43a7ba66ac1bc0b8d4c22f756d40c2d55fa48c98ff95c996225bd3c5a6bd4b26
MD5 e6b3dabc8aba44e41017cad200208d1f
BLAKE2b-256 279a650d6df02d1d2716ec4a4311040ec53c77ac0349773b6d46636702571394

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page