Skip to main content

Watch directories for changes to RST files and generate HTML

Project description

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.

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

The source code is hosted at: https://sourceforge.net/projects/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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rstwatch-1.0.3.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rstwatch-1.0.3-py2.py3-none-any.whl (8.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file rstwatch-1.0.3.tar.gz.

File metadata

  • Download URL: rstwatch-1.0.3.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

File hashes

Hashes for rstwatch-1.0.3.tar.gz
Algorithm Hash digest
SHA256 28cc43ca4c3a470088d004a9c48643a16e60ab4fb6db75a8f8e1d0e7d3d117ef
MD5 36dacaddf1568744e81fb66175497b3a
BLAKE2b-256 9532249124fc06c768565906cb2a83c118b0b2993dad932137c19f80ac0636ae

See more details on using hashes here.

File details

Details for the file rstwatch-1.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: rstwatch-1.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

File hashes

Hashes for rstwatch-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6728732ffc4af92b598acc480c6d3785766d4393cf87fe95d5b7f04f3640082e
MD5 86408a56c1373b7ae8893549f6953aa9
BLAKE2b-256 1258a2405e282b4ea1344118fa707158d3a385c29586d01ab16b28d6ef0f887c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page