Convert reStructuredText to plain text
Project description
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())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rst2txt-1.1.0.tar.gz
.
File metadata
- Download URL: rst2txt-1.1.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ded9e4fb2686f039eb06c0608980fd13982998ce365a9d008a495649ed85f7cd |
|
MD5 | 112f046ce7b996f09de64f07130cbe4f |
|
BLAKE2b-256 | c9a2e0f1a134b2aceb5910776c1bfc804f4343f5a6cc221909d9fc7cb6c8dd48 |
File details
Details for the file rst2txt-1.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: rst2txt-1.1.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.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 658e072c2eeb64debf14552c6f08b5ed26b05ddd2206459a03582ed7cb0e944a |
|
MD5 | 3ad7d672ab0434e14737255db50f2f98 |
|
BLAKE2b-256 | 9dd4cee0341774dbdd4c128816ebc31fbbf39a11c79220a96a4f1152aa511caa |