3 # Philippe Chauvat - BaculaSystems
4 # Last modification 26-feb-2014
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/pdf-and-html"
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
66 # Extract the directory name: console, developers, main, etc.
67 thedirname=`echo $M | sed -e 's/.*www-\(.*\)/\1/g'`
69 # Message to indicate what we are building
72 echo "$thedirname Manual"
74 # Where to find HTML files
75 readdir=$M/$thedirname
77 # Where to store the result
78 DESTINATION_DIR=$SOURCEDIRHEAD/$thedirname
80 # Create the desitnation directory if needed
81 mkdir -p $DESTINATION_DIR
83 # Create otherdirs if needed
84 for D in ${DIRSTOCREATE}
86 mkdir -p $SOURCEDIRHEAD/$D
88 for L in `ls ${readdir}|egrep html$`
90 echo -n "Translating $L..."
91 ./translatedoc.pl ${DEBUG} -i ${readdir}/${L} -o ${DESTINATION_DIR}/${L} -j ${JSDIR} -c ${CSSDIR} -p ${IMAGEDIR} -n ${thedirname}
94 echo "Moving CSS file..."
95 cp ${readdir}/${thedirname}.css ${SOURCEDIRHEAD}/css/
103 # Extract the directory name: console, developers, main, etc.
104 thedirname=`echo $M | sed -e 's/.*www-\(.*\)/\1/g'`
106 # Where to find HTML files
107 readdir="${readdir} $SOURCEDIRHEAD/$thedirname"
110 cp -v ${SOURCEIMAGEDIR}/$(M)/$(thedirname)/*.png ${DESTIMAGEDIR}/
112 echo "./handle-xr-references.pl -m \"${readdir}\" -i list-of-anchors -l en"
113 ./handle-xr-references.pl -m "${readdir}" -d -i list-of-anchors -l en
115 rm -f list-of-anchors