Author: | David Handy <cpif@handysoftware.com> |
---|
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.
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.
rstwatch is an open source program written in the Python programming language. (See the license.)
First, install Python if you haven't already. It is freely available for Windows, MacOS, and Linux (it is likely already installed on MacOS or Linux.)
Next, install rstwatch from the Python Package Index using the pip command:
pip install rstwatch
The source code is hosted at: https://sourceforge.net/projects/rstwatch/
rstwatch [options] <directory>...
Options:
--exit | Exit after first pass, instead of repeat scanning |
--interval=SECONDS | |
Seconds to delay between directory scans [default: 2.0] | |
--log-config=FILENAME | |
(Optional) Custom logging configuration file | |
--refresh | Regenerate all html files on first scan |
--writer=WRITER_NAME | |
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