3 # Build all the xHTML files for Project Aon in a single run
5 # (c) 2011 Javier Fernandez-Sanguino <jfs@computer.org>
7 # This script is provided with the same license as that one
8 # used in the Aon Project
13 [ -z "$AONDIR" ] && AONDIR="../../"
14 [ -z "$LANGS" ] && LANGS="en es"
15 LOGDIR="$CURDIR/logs/"
16 [ ! -e "$LOGDIR" ] && mkdir $LOGDIR
25 ls ${AONDIR}/${lang}/xml/$1.xml |
27 if [ -r "$file" ]; then
28 xml=`basename $file | sed -e 's/\.xml//'`
29 # Look for the XML name in the metadata file
30 if grep -q ^$xml $METADATA; then
31 echo -n "Generating XHTML for $xml ('$lang' language)..."
32 LOGFILE=$LOGDIR/$xml.xhtml.log
35 perl common/scripts/gbtoxhtml.pl --language=$lang $xml >$LOGFILE 2>&1
37 echo " ERROR building Xhtml file (review $LOGFILE)"
40 LOGFILE=$LOGDIR/$xml.xhtml-simple.log
41 echo -n "Building XHTML simple"
42 perl common/scripts/gbtoxhtml-simple.pl --language=$lang $xml >$LOGFILE 2>&1
44 echo " ERROR building xhtml simple file (review $LOGFILE)"
47 LOGFILE=$LOGDIR/$xml.xhtml-less-simple.log
48 echo -n "Building XHTML less simple"
49 perl common/scripts/gbtoxhtml-less-simple.pl --language=$lang $xml >$LOGFILE 2>&1
51 echo " ERROR building xhtml less simple file (review $LOGFILE)"
57 echo "WARN: Cannot find metadata for $xml in $METADATA"
60 echo "ERROR: Cannot generate xhtml file for $xml (not readable)"
65 for lang in $LANGS; do
66 METADATA=${AONDIR}/${lang}/.publisher/rules/simple
67 if [ -e "$METADATA" ] ; then
68 generate_files "$BOOKS"
70 echo "ERROR: Cannot find the publisher rules at $METADATA for $lang"