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
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
[13632]10
[13782]11if [ ! -d $output_dir ]; then
12 mkdir $output_dir
[13632]13fi
14
[18741]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
[14606]21else
[18741]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
[14606]33fi
[13881]34
[18741]35#sus out what languages to build in
36all_langs="en es ru fr ar"
37if [ "$2" == "all" ]; then
38 langs=$all_langs
[13881]39
[18741]40elif [ "$2" != "" ]; then
[14606]41 langs=$2
42else
[18741]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
[14606]49 fi
[13881]50fi
51
[18741]52echo "Manuals: $manuals"
53echo "Languages: $langs"
54echo
55
[13782]56for l in $langs; do
[13881]57
[13782]58 if [ ! -d $output_dir/$l ]; then
[13881]59 mkdir $output_dir/$l
[13864]60 fi
[13881]61 if [ ! -d $output_dir/$l/pdf ]; then
62 mkdir $output_dir/$l/pdf
63 fi
64
65 for m in $manuals; do
[18741]66 echo "Processing the $m manual in $l"
[13864]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
[18741]68 echo "done"
[13782]69 done
70done
Note: See TracBrowser for help on using the repository browser.