Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Modify valid rst text to fit within given width

Project description

Installation

>>> sudo pip install reflowrst

Usage

Example:

>>> from reflowrst import reflow
>>> text = 'Here is a paragraph that is far too long and will need to wrap.'
>>> print(reflow(text, 47))
Here is a paragraph that is far too long and
will need to wrap.

You can also get the longest possible form of the rst text by using 0 for the space. For example:

>>> paragraph = '''Here is a paragraph that is far too long and
will need to wrap.'''
>>> print(reflow(paragraph, 0))
Here is a paragraph that is far too long and will need to wrap.

Todo

  • ☑ Titles
  • ☑ Transitions
  • ☑ Paragraphs
  • ☑ Bullet Lists
  • ☑ Enumerated Lists
  • ☑ Definitions
  • ☑ Fields
  • ☑ Options
  • ☑ Literal Blocks
  • ☐ Quoted Literal Blocks
  • ☑ Line Blocks
  • ☑ Block Quotes
  • ☐ Doctest Blocks
  • ☑ Grid Tables
  • ☑ Simple Tables
  • ☑ Footnotes
  • ☑ Citations
  • ☑ Directives

Project details


Download files

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

Files for reflowrst, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size reflowrst-1.1.0.tar.gz (46.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page