#!/bin/sh # $Id: gtpublish,v 1.4 2002/12/13 19:58:19 camerons Exp $ # # Publish docbook files and docbook files which contain # tags into html files. # Results are stored in the ${target} directory. # Note, you will need to install xsltproc. With a bit of luck, it should # already be installed as part of your linux distrubution. # # This script expects to be installed in the geotools directory structure. # It needs to be run from this directory. # # Original Author: Cameron Shorter cameron@shorter.net # # Directories are relative to the root directory of this script imageSource="sdocbook/images \ ../defaultcore/sdocbook/images \ ../sldstyling/xdocs/images" docbookSource="sdocbook" target="www" xsl=../../extbin/gtbuild/docbook-xsl/html/docbook.xsl sourceFiles="${docbookSource}/*.xml" # All directory names are relative to this script root, so change directory # to the root directory cd `dirname ${0}` mkdir -p ${target} # copy the image files mkdir -p ${target}/images for imageDir in ${imageSource}; do for file in `find ${imageDir} -print | grep -v "/CVS"`; do targetFile=`echo $file | sed -e"s/^.*images/images/"` mkdir -p ${target}/`dirname ${targetFile}` cp -p ${file} ${target}/${targetFile} done done # translate the docbook files for file in $sourceFiles; do baseFile=`basename $file` baseFile=`echo $baseFile | sed -e"s/\.sgml$//"` baseFile=`echo $baseFile | sed -e"s/\.xml$//"` xsltproc --novalid --xinclude \ --param section.autolabel 1 \ --param toc.section.depth 5 \ -o ${target}/$baseFile.html ${xsl} ${file} done