Watch directories for changes to RST files and generate HTML
|Author:||David Handy <firstname.lastname@example.org>|
This simple static website generator scans directories for .rst files (text files in reStructuredText format) and converts them to HTML documents using docutils. By default it runs continuously. Whenever an .rst file (or a file included by an .rst file) is added or changed, the associated .html file is immediately created or re-generated.
- In your web content directory run: rstwatch .
- Create an .rst file in that directory, e.g. named index.rst
- Immediately a file named index.html appears in that same directory
- Point your web browser to the index.html file
- In your editor window, make a change to index.rst and save it
- In your browser window, hit the refresh button
- Boom! You see your changes, converted to HTML, right away
- When you are done, press Ctrl-C to stop rstwatch
You can use rstwatch to learn and experiment with docutils and the reStructuredText format. This can be a stepping-stone to using a more complicated, fully-featured document generation system based on docutils, such as Sphinx.
pip install rstwatch
The source code is hosted at: https://sourceforge.net/projects/rstwatch/
rstwatch [options] <directory>...
|--exit||Exit after first pass, instead of repeat scanning|
|Seconds to delay between directory scans [default: 2.0]|
|(Optional) Custom logging configuration file|
|--refresh||Regenerate all html files on first scan|
|Docutils writer name. [default: html5]|
For the (optional) log configuration file format, see: https://docs.python.org/3/library/logging.config.html#configuration-file-format
Example log config file: log-config.ini
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size & hash||File type||Python version||Upload date|
|rstwatch-1.0.3-py2.py3-none-any.whl (8.6 kB) View hashes||Wheel||py2.py3|
|rstwatch-1.0.3.tar.gz (11.0 kB) View hashes||Source||None|
Hashes for rstwatch-1.0.3-py2.py3-none-any.whl