-new_m5=$( md5sum user.rst | sed 's/ .*//' )
-old_md5=$( md5sum $sdir/user-guide.rst | sed 's/ .*//' )
-if [[ $new_m5 != $old_m5 ]]
-then
- echo "publishing user-guide.rst"
- cp user.rst $sdir/user-guide.rst
-fi
+for f in *.rst
+do
+ touch $sdir/$f # must ensure it is there if new
+ new_md5=$( md5sum $f | sed 's/ .*//' )
+ old_md5=$( md5sum $sdir/$f | sed 's/ .*//' )
+
+ if [[ $new_md5 != $old_md5 ]]
+ then
+ echo "publishing $f"
+ cp $f $sdir/$f
+ fi
+done