A viewer for ReStructuredText documents that renders them on the fly.
Pass the name of a ReStructuredText document to restview, and it will launch a web server on localhost:random-port and open a web browser. It will also watch for changes in that file and automatically reload and rerender it. This is very convenient for previewing a document while you're editing it.
You can also pass the name of a directory, and restview will recursively look for files that end in .txt or .rst and present you with a list.
$ restview [options] /path/to/filename.txt [...]
restview can also serve a listing of all txt and rst files in a directory tree.
$ restview [options] /path/to/directory [...]
Or it can run a command to generate the ReStructuredText .
$ restview [options] -e "python setup.py --long-description"
There's a shortcut for that particular useful example:
$ restview [options] --long-description
This mode doesn't have automatic reloading on file changes, but it will re-execute that command whenever you reload the browser page.
-h, --help show this help message and exit -l PORT, --listen=PORT listen on a given port (or interface:port, e.g. *:8080) [default: random port on localhost] -b, --browser open a web browser [default: only if -l was not specified] -e COMMAND, --execute=COMMAND run a command to produce ReStructuredText --long-description run "python setup.py --long-description" to produce ReStructuredText --css=URL-or-FILENAME use the specified stylesheet --strict halt at the slightest problem
restview is available from the Python Package Index: http://pypi.python.org/pypi/restview. You can also pip install restview.
(You will need docutils and pygments, but pip takes care of all that.)
You can get the latest version of the source code from GitHub:
git clone https://github.com/mgedmin/restview.git
Or you can browse the repository on the Web.
restview was written by Marius Gedminas. It is released under the terms of the GNU GPL.
Please report bugs on GitHub.