dev@jax-ws.java.net

Writing user documents productively

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 23 Oct 2006 14:19:25 -0700

Arun mentioned that the use of htmlmacro made it harder to use HTML
editors, so this e-mail explains a tip that I do to compensate that.

The attached program is written in .NET. It takes a list of files as an
argument, and monitors any change in those files. When a change is
detected, it returns a non-0 exit code. Or you can also hit ENTER to
terminate the program immediately with 0 exit code.

This program, with a bit of scripting, can be very handy with
automatically doing some work when something happens. The following
script is what I use to automatically run htmlmacro whenever I hit
'save' on the editor. This allows me to get a relatively quick feedback
on what's I'm typing.

#!/bin/sh
while true;
do
   WaitForChange docs/*.html docs/style/*.css
   [ $? != 0 ] || exit;
   ant docs
done

The program can be used for other small automations.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com