========
|buildstatus| |appveyor| |coverage|_
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.
Every time you reload the page, restview will reload the document from
disk and render 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.
Finally, you can make sure your Python package has valid ReStructuredText in the long_description field by using ::
restview --long-description
Usage: restview [options] filename-or-directory [...]
-h, --help show this help message and exit --version show program's version number and exit -l PORT, --listen=PORT listen on a given port (or interface:port, e.g. *:8080) [default: random port on localhost] --allowed-hosts HOSTS allowed values for the Host header (default: localhost only, unless you specify -l *:port, in which case any Host: is accepted by default) -b, --browser open a web browser [default: only if -l was not specified] -B, --no-browser don't open a web browser -e COMMAND, --execute=COMMAND run a command to produce ReStructuredText on stdout -w FILENAME, --watch=FILENAME reload the page when a file changes (use with --execute); can be specified multiple times --long-description run "python setup.py --long-description" to produce ReStructuredText; also enables --pypi-strict and watches the usual long description sources (setup.py, README.rst, CHANGES.rst) --css=URL-or-FILENAME use the specified stylesheet; can be specified multiple times [default: html4css1.css,restview.css] --report-level REPORT_LEVEL set the "report_level" option of docutils; restview will report system messages at or above this level (1=info, 2=warnings, 3=errors, 4=severe) --halt-level HALT_LEVEL set the "halt_level" option of docutils; restview will stop processing the document when a system message at or above this level (1=info, 2=warnings, 3=errors, 4=severe) is logged --strict halt at the slightest problem; equivalent to --halt- level=2 --pypi-strict enable additional restrictions that PyPI performs
On .deb based systems (e.g. Ubuntu) ::
sudo apt-get install python-pip sudo pip install restview
On .rpm based systems (e.g. Fedora) ::
su yum install python-pip pip install restview
.. |buildstatus| image:: https://github.com/mgedmin/restview/workflows/build/badge.svg?branch=master .. _buildstatus: https://github.com/mgedmin/restview/actions
.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/mgedmin/restview?branch=master&svg=true .. _appveyor: https://ci.appveyor.com/project/mgedmin/restview
.. |coverage| image:: https://coveralls.io/repos/mgedmin/restview/badge.svg?branch=master .. _coverage: https://coveralls.io/r/mgedmin/restview
Fix incompatibility with docutils 0.18.1 that resulted in "Cannot embed
stylesheet" errors (issue 61 <https://github.com/mgedmin/restview/pull/61>
_,
contributed by Sébastien Besson).
Add support for Python 3.8, 3.9, and 3.10.
Drop support for Python 3.5.
Claim Python 3.7 support.
Drop Python 3.4 support.
Ignore stderr from external commands that successfully produce stdout
(like warnings printed by setup.py --long-description).
Fixes #55 <https://github.com/mgedmin/restview/issues/55>
_.
Cope with readme_renderer.clean.clean() returning None on failure.
__main__.py
module to allow package to be executable with
python -m restview
. - SimplyKnownAsG#51 <https://github.com/mgedmin/restview/issues/51>
_.Claim Python 3.6 support.
Drop Python 3.3 support.
New option --report-level
that defaults to 2 (previously this was
hardcoded to 0). See #49 <https://github.com/mgedmin/restview/issues/49>
_.
Relax --strict
to mean --halt-level=2
(previously it meant
--halt-level=1
). See #49
_.
New option --halt-level
(#44 <https://github.com/mgedmin/restview/pull/44>
_), contributed by Kunshan
Wang.
New option -B
/--no-browser
(#46 <https://github.com/mgedmin/restview/issues/46>
_).
readme
dependency was renamed readme_renderer
(fixes
#30 <https://github.com/mgedmin/restview/issues/30>
,
#41 <https://github.com/mgedmin/restview/issues/41>
).Implement restview --version
(#37 <https://github.com/mgedmin/restview/issues/37>
_).
Highlight the bad source line when rendering fails completely due to an
error, e.g. in --strict
mode (#40 <https://github.com/mgedmin/restview/issues/40>
_).
#36 <https://github.com/mgedmin/restview/issues/36>
_).#36 <https://github.com/mgedmin/restview/issues/36>
_).Fix HTML cleaning code in --pypi-strict mode (#33 <https://github.com/mgedmin/restview/issues/33>
_).
Drop Python 2.6 support.
Claim Python 3.5 support.
Drop Python 3.2 support.
Stop dynamic computation of install_requires in setup.py, this doesn't work well in the presence of the pip 7 wheel cache.
readme <https://pypi.python.org/pypi/readme>
__ for rendering in --pypi-strict mode.
Fixes https://github.com/mgedmin/restview/issues/28.Reload the page using AJAX to preserve scroll position. Fixes https://github.com/mgedmin/restview/issues/22.
Use the default docutils CSS instead of replacing it wholesale. Drop some of our styles, including:
Keep other custom style overrides:
The --css
option can be provided multiple times and can refer to
standard stylesheets (the ones provided by docutils as well as the ones
provided by restview) without specifying the full path.
For example, if you want to go back to the style used by restview before version 2.2.0, you can use ::
restview --css oldrestview.css ...
If you want your own custom style on top of the standard docutils styles, use ::
restview --css html4css1.css --css ./path/to/my.css
And if you want to completely override the stylesheet, use ::
restview --css ./path/to/my.css
New option: --watch
. Reloads pages when a given file changes. Mostly
useful with -e
, but can also come in handy when you're developing your
CSS. Can be specified multiple times, e.g. ::
restview --css my.css -e 'cat one.rst two.rst' -w my.css -w one.rst -w two.rst
restview --long-description
watches setup.py, README.rst and CHANGES.rst
for updates and reloads the description automatically.
Error pages will also reload automatically if the source file changes.
Error pages in strict mode will mention the filename instead of <string>
.
File watching now pays attention to fractional seconds.
Fix TypeError on Python 3 when reporting ReST errors (typically in strict mode). Fixes https://github.com/mgedmin/restview/issues/21.
Fix TypeError on Python 3 when using --pypi-strict
.
--pypi-strict
mode to catch additional problems that break rendering
on the Python Packaging Index. --long-description
enables this
automatically.
Fixes https://github.com/mgedmin/restview/issues/18.
Added installation section to the README. Fixes https://github.com/mgedmin/restview/issues/19.
Avoid Unicode errors on Python 3 when the ReStructuredText file is in an encoding that doesn't match the locale. Fixes https://github.com/mgedmin/restview/issues/16.
Avoid Unicode errors on Python 3when there are filenames in an encoding that doesn't match the locale. Fixes https://github.com/mgedmin/restview/issues/17.
Show a clear error when external command fails. Fixes https://github.com/mgedmin/restview/issues/14.
Stop mangling document titles. Fixes https://github.com/mgedmin/restview/issues/15.
Distinguish document title from section titles with a larger font. Fixes https://github.com/mgedmin/restview/issues/12.
Minor tweaks and fixes to make restview work better on Windows (e.g. all tests now pass).
Suppress errors when file disappears while restview is polling for changes. Fixes https://github.com/mgedmin/restview/issues/11.
Added a favicon. Fixes https://github.com/mgedmin/restview/issues/8.
Python 3 support (LP#1093098). Patch by Steven Myint (git@stevenmyint.com).
Moved to Github.
100% test coverage.
Automatically reload the web page when the source file changes (LP#965746). Patch by speq (sp@bsdx.org), with modifications by Eric Knibbe and Marius Gedminas.
New option: restview --long-description (shows the output of python setup.py --long-description).
New option: restview --strict. Patch by Steven Myint (git@stevenmyint.com).
Improve auto-linkification of local file names:
Many improvements by Eric Knibbe:
restview dirname
now ignores hidden subdirectories.Handle spaces and other special characters in URLs (LP#616335).
Don't linkify filenames inside external references (LP#634827).
Version | Tag | Published |
---|---|---|
3.0.0 | 1yr ago | |
2.9.3 | 1yr ago | |
2.9.2 | 4yrs ago | |
2.9.1 | 5yrs ago |