3 # Philippe Chauvat - BaculaSystems
4 # Last modification 04-dec-2012
6 # This script fetch all HTML 'manual' directories
7 # to apply a conversion script (translatedoc.pl)
8 # and then produce the final HTML version of the manuals
13 # SOURCEDIRHEAD: Where are located the original directories relatively to the
15 # Default: ../manuals/en
17 # TRANSLATOR: The script to apply to each HTML original file
18 # Default: ./translatedoc.pl
20 # DEBUG: You want some ? Specify -d there
23 # FROMFILEMENUEXTRACT: We want to extract ako menu. This var give the name of the file
24 # from which to extract it
27 # DIRSTOCREATE: Specify here which directory(ies) must be created before running the conversion
28 # Default: "css js images"
30 # LIST The list of dirs containing the manuals to translate
31 # Default: `find ${SOURCEDIRHEAD} -mindepth 1 -maxdepth 1 -name "www-*" -type d`
33 # ROOTDIR All HTML files rely on CSS, JS and IMAGES. ROOTDIR specify the relative path to those.
36 # CSSDIR The CSS directory used by HTMLs
37 # Default: ${ROOTDIR}/css
39 # JSDIR The JS (javascript) directory used by HTMLs
40 # Default: ${ROOTDIR}/js
42 # IMAGEDIR The images directory used by HTMLs
43 # Default: ${ROOTDIR}/images
45 # DOSUBFILES Do we want to generate all subfiles (not only the index.html). Debug and tests purpose
48 SOURCEDIRHEAD="../manuals/en"
49 TRANSLATOR='./translatedoc.pl'
50 DEBUG="" # change to -d if you want some debug there
51 FROMFILEMENUEXTRACT="index.html"
52 DIRSTOCREATE="css js images"
53 LIST=`find ${SOURCEDIRHEAD} -mindepth 1 -maxdepth 1 -name "www-*" -type d`
54 #LIST=${SOURCEDIRHEAD}/www-main
58 IMAGEDIR=${ROOTDIR}/images
59 SOURCEIMAGEDIR=../images
60 DESTIMAGEDIR=${SOURCEDIRHEAD}/images
62 # Do we want to generate HTML files for all
70 # Extract the directory name: console, developers, main, etc.
71 thedirname=`echo $M | sed -e 's/.*www-\(.*\)/\1/g'`
73 # Message to indicate what we are building
74 echo "$thedirname Manual"
76 # Where to find HTML files
77 readdir=$M/$thedirname
79 # Where to store the result
80 DESTINATION_DIR=$SOURCEDIRHEAD/$thedirname/$thedirname
82 # Create the desitnation directory if needed
83 mkdir -p $DESTINATION_DIR
85 # Create otherdirs if needed
86 for D in ${DIRSTOCREATE}
88 mkdir -p $SOURCEDIRHEAD/$D
91 # Building the menu must be done without any existing file
92 rm -f wholemenu_${thedirname}.html
93 echo -n "Building navigation menu from ${readdir}/${FROMFILEMENUEXTRACT} to ${DESTINATION_DIR}/${FROMFILEMENUEXTRACT}..."
94 ./translatedoc.pl ${DEBUG} -i ${readdir}/${FROMFILEMENUEXTRACT} -e -o ${DESTINATION_DIR}/${FROMFILEMENUEXTRACT} -j ${JSDIR} -c ${CSSDIR} -p ${IMAGEDIR} -n ${thedirname} -r ${SOURCEDIRHEAD}
96 if [ ${DOSUBFILES} == "yes" ]
98 for L in `ls ${readdir}|egrep html$`
100 echo -n "Translating $L..."
101 ./translatedoc.pl ${DEBUG} -i ${readdir}/${L} -o ${DESTINATION_DIR}/${L} -j ${JSDIR} -c ${CSSDIR} -p ${IMAGEDIR} -n ${thedirname}
108 cp -v ${SOURCEIMAGEDIR}/png/*.png ${DESTIMAGEDIR}/