» django-sphinxdoc » Auto-build JSON files on hg pull/push

Prev: Quickstart Guide Next: Change your documentation’s appearance

Auto-build JSON files on hg pull/push

If you use Mercurial (hg) for the application you are documenting, you can automatically call sphinx-build each time you push or pull to the clone on your webserver (the same machine running your Django project).

You need two things to accomplish this:

  1. A script that performs the build
  2. Make hg call that script

The build script

A good place for the script is the .hg/ directory of your repository on the server. Change to that directory and create a file called makedoc:

#! /bin/bash

cd /path/to/your/repo
hg up
cd /path/to/your/repo/doc
make json

Make hg call that script

Open .hg/hgrc in your favorite editor and add the following lines to it:

[hooks]
changegroup = /path/to/your/repo/.hg/makedoc

Done

Now, each time the repository is modified via a pull or push command, the documentation will be updated automatically.

Prev: Quickstart Guide Next: Change your documentation’s appearance

» django-sphinxdoc documentation » Auto-build JSON files on hg pull/push

Last update: 2010-06-24 12:24 (CET)