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

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

improved generate-pdf scripts

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
1#!/bin/bash
2
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
10
11if [ ! -d $output_dir ]; then
12 mkdir $output_dir
13fi
14
15#sus out what manuals to build
16all_manuals="Paper User Develop Install"
17if [ "$1" == "all" ]; then
18 manuals=$all_manuals
19elif [ "$1" != "" ]; then
20 manuals=$1
21else
22 echo "choose a manual to work with:"
23 echo "'all' for all the manuals"
24 echo "'User' for the User's Guide"
25 echo "'Develop' for the Developer's Guide"
26 echo "'Install' for the Installer's Guide"
27 echo "'Paper' for From Paper to Collection"
28 echo -n "> "
29 read manuals
30 if [ "$manuals" == "all" ]; then
31 manuals=$all_manuals
32 fi
33fi
34
35#sus out what languages to build in
36all_langs="en es ru fr ar"
37if [ "$2" == "all" ]; then
38 langs=$all_langs
39
40elif [ "$2" != "" ]; then
41 langs=$2
42else
43 echo "choose a language to work with out of: $all_langs"
44 echo "choose 'all' for all languages"
45 echo -n "> "
46 read langs
47 if [ "$langs" == "all" ]; then
48 langs=$all_langs
49 fi
50fi
51
52echo "Manuals: $manuals"
53echo "Languages: $langs"
54echo
55
56for l in $langs; do
57
58 if [ ! -d $output_dir/$l ]; then
59 mkdir $output_dir/$l
60 fi
61 if [ ! -d $output_dir/$l/pdf ]; then
62 mkdir $output_dir/$l/pdf
63 fi
64
65 for m in $manuals; do
66 echo "Processing the $m manual in $l"
67 $fop_dir/fop.sh -c $shared_dir/fop/conf/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
68 echo "done"
69 done
70done
Note: See TracBrowser for help on using the repository browser.