Watch directories for changes to RST files and generate HTML
Project description
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.
Example
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.
Installation Instructions
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
Alternatively, you can install the very latest version of rstwatch directly from its home on bitbucket:
pip install https://bitbucket.org/dhandy2013/rstwatch/get/tip.zip#egg=rstwatch
Usage
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for rstwatch-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6205a0460a522ea2f3fdf71196502216eabdd982b3016ac685f3e6a14b5f780f |
|
MD5 | 91a79a9f3ee02d2746c1f76e3fb66236 |
|
BLAKE2b-256 | 9b27a286acc5f3c1eafecf240242086e2e7187398294d3f329d499e3ea8005fe |