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
76 echo "$thedirname Manual"
78 # Where to find HTML files
79 readdir=$M/$thedirname
81 # Where to store the result
82 DESTINATION_DIR=$SOURCEDIRHEAD/$thedirname/$thedirname
84 # Create the desitnation directory if needed
85 mkdir -p $DESTINATION_DIR
87 # Create otherdirs if needed
88 for D in ${DIRSTOCREATE}
90 mkdir -p $SOURCEDIRHEAD/$D
93 # Building the menu must be done without any existing file
94 rm -f wholemenu_${thedirname}.html
95 echo -n "Building navigation menu from ${readdir}/${FROMFILEMENUEXTRACT} to ${DESTINATION_DIR}/${FROMFILEMENUEXTRACT}..."
96 ./translatedoc.pl ${DEBUG} -i ${readdir}/${FROMFILEMENUEXTRACT} -e -o ${DESTINATION_DIR}/${FROMFILEMENUEXTRACT} -j ${JSDIR} -c ${CSSDIR} -p ${IMAGEDIR} -n ${thedirname} -r ${SOURCEDIRHEAD}
98 if [ ${DOSUBFILES} == "yes" ]
100 for L in `ls ${readdir}|egrep html$`
102 echo -n "Translating $L..."
103 ./translatedoc.pl ${DEBUG} -i ${readdir}/${L} -o ${DESTINATION_DIR}/${L} -j ${JSDIR} -c ${CSSDIR} -p ${IMAGEDIR} -n ${thedirname}
114 # Extract the directory name: console, developers, main, etc.
115 thedirname=`echo $M | sed -e 's/.*www-\(.*\)/\1/g'`
117 # Where to find HTML files
118 readdir="${readdir} $SOURCEDIRHEAD/$thedirname/$thedirname"
120 echo "./handle-xr-references.pl -m \"${readdir}\" -i list-of-anchors -l en"
121 ./handle-xr-references.pl -m "${readdir}" -i list-of-anchors -l en
124 cp -v ${SOURCEIMAGEDIR}/png/*.png ${DESTIMAGEDIR}/