#!/bin/sh # $Id: gtpublish,v 1.9 2003/09/05 11:47:55 kobit 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 \ ../core/sdocbook/images \ ../sldstyling/xdocs/images" resources="resources" docbookSource="sdocbook" target="www" xsl="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 # copy the resources files cp -pr ${docbookSource}/${resources} ${target} #cp -pr sdocbook/resources ${target} # 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$//"` # Code simplified a little by Artur Hefczyc Tue Jun 03 12:05:56 2003 # Please let me know it there will be problems on other # operating systems. I tested it on CygWin+WinXP and Gentoo linux. baseFile=`basename $file .xml` baseFile=`basename $baseFile .sgml` xsltproc --novalid --xinclude \ --param section.autolabel 1 \ --param toc.section.depth 5 \ -o ${target}/$baseFile.html ${xsl} ${file} done