source: documentation/trunk/manuals/generate-pdf.sh@ 20741

Last change on this file since 20741 was 18812, checked in by oranfry, 15 years ago

more changes to the generate-pdf.sh script to make the last changes backwards-compatible

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
RevLine 
[18741]1#!/bin/bash
[13632]2
[13782]3top_dir=`pwd`
4shared_dir=`pwd`/../shared
5source_dir=`pwd`/xml-source
6processing_dir=`pwd`/processing
7output_dir=`pwd`/build
8fop_dir="$shared_dir/fop"
9export CLASSPATH=$CLASSPATH:$shared_dir:$fop_dir/build/fop.jar:$fop_dir/lib
[18743]10export JAVA_OPTS="-Xmx1024M $JAVA_OPTS"
[13632]11
[13782]12if [ ! -d $output_dir ]; then
13 mkdir $output_dir
[13632]14fi
15
[18741]16#sus out what manuals to build
17all_manuals="Paper User Develop Install"
18if [ "$1" == "all" ]; then
19 manuals=$all_manuals
20elif [ "$1" != "" ]; then
21 manuals=$1
[14606]22else
[18741]23 echo "choose a manual to work with:"
24 echo "'all' for all the manuals"
25 echo "'User' for the User's Guide"
26 echo "'Develop' for the Developer's Guide"
27 echo "'Install' for the Installer's Guide"
28 echo "'Paper' for From Paper to Collection"
29 echo -n "> "
30 read manuals
[18743]31 if [ "$manuals" = "all" ]; then
[18741]32 manuals=$all_manuals
33 fi
[14606]34fi
[13881]35
[18741]36#sus out what languages to build in
37all_langs="en es ru fr ar"
38if [ "$2" == "all" ]; then
39 langs=$all_langs
[13881]40
[18741]41elif [ "$2" != "" ]; then
[14606]42 langs=$2
43else
[18741]44 echo "choose a language to work with out of: $all_langs"
45 echo "choose 'all' for all languages"
46 echo -n "> "
47 read langs
[18743]48 if [ "$langs" = "all" ]; then
[18741]49 langs=$all_langs
[14606]50 fi
[13881]51fi
52
[18812]53#show what manuals and languages will be used
[18741]54echo "Manuals: $manuals"
55echo "Languages: $langs"
56echo
57
[18812]58#do it
[13782]59for l in $langs; do
[13881]60
[18812]61 if [ ! -d $output_dir/$l ]; then
[13881]62 mkdir $output_dir/$l
[13864]63 fi
[13881]64 if [ ! -d $output_dir/$l/pdf ]; then
65 mkdir $output_dir/$l/pdf
66 fi
67
68 for m in $manuals; do
[18812]69 #hack to preserve old way of specifying manuals
70 if [ "$m" == "u" ]; then m=User;
71 elif [ "$m" == "d" ]; then m=Develop;
72 elif [ "$m" == "i" ]; then m=Install;
73 elif [ "$m" == "p" ]; then m=Paper; fi
74
[18743]75 echo -n "Processing the $m manual in $l..."
[18747]76 $fop_dir/fop.sh -c $processing_dir/fop-fonts/userconfig.xml -q -xsl $processing_dir/xml-to-pdf.xsl -xml $source_dir/$l/"$m"_"$l".xml -pdf $output_dir/$l/pdf/"$m"_"$l".pdf
[18741]77 echo "done"
[13782]78 done
79done
Note: See TracBrowser for help on using the repository browser.