Changeset 345 for trunk/SRC/Documentation/xmldoc/firststeps_pre.sh
- Timestamp:
- 04/16/08 11:15:20 (16 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/xmldoc/firststeps_pre.sh
r326 r345 1 #!/bin/bash -x 1 #! /bin/sh 2 # 3 # module : 4 # ++ working on firststeps.xml before processing for HTML and wiki 2 5 # 3 6 # update : 4 7 # $Id$ 5 # 6 # ++ one day we can add accessibility check with tidy with -access 3 7 # diagnostics are not so good so far because tidy (HTML Tidy for Mac OS X 8 # released on 1 September 2005) doesn't handle carriage returns 9 # 10 # fplod 2007-06-27T11:54:26Z aedon.locean-ipsl.upmc.fr (Darwin) 11 # replacing saxon by xalan because of better results on callouts 12 # fplod 2006-09-20T16:28:32Z aedon.locean-ipsl.upmc.fr (Darwin) 13 # remove ?format=raw 14 # fplod 2006-09-18T12:53:07Z aedon.locean-ipsl.upmc.fr (Darwin) 15 # add status checking in xml processing 16 # fplod 2006-09-07T08:10:23Z aedon.locean-ipsl.upmc.fr (Darwin) 17 # main is rename to websaxo.html 18 # fplod 2006-08-29T14:01:11Z aedon.locean-ipsl.upmc.fr (Darwin) 19 # add main which needs xmllint processing to resolve xinclude 20 # fplod 2006-08-18T13:38:31Z aedon.locean-ipsl.upmc.fr (Darwin) 21 # add faqsaxo which needs xmllint processing to resolve xinclude 22 # fplod 2006-07-21T08:25:05Z aedon.locean-ipsl.upmc.fr (Darwin) 23 # add prerequisites for mini_notice production 24 # fplod 2006-07-12T11:57:24Z aedon.locean-ipsl.upmc.fr (Darwin) 25 # add style.css 26 # fplod 2006-07-11T08:25:30Z aedon.locean-ipsl.upmc.fr (Darwin) 27 # use of tidy and titlepage.saxo.xml 28 # replace /sw/share/xml/xsl/docbook-xsl/html/docbook.xsl 29 # by saxo_html.xsl 30 # fplod 2006-07-05T13:18:56Z aedon.locean-ipsl.upmc.fr (Darwin) 31 # add infoupdatecm 32 # add sort and varname in production of infoupdatekwd 33 # fplod 2006-06-07T13:55:07Z aedon.locean-ipsl.upmc.fr (Darwin) 34 # add infoupdatekwd 35 # fplod 2006-06-02T14:37:47Z aedon.locean-ipsl.upmc.fr (Darwin) 36 # take only one tar file : the most recent using modification time 37 # fplod 2006-06-02T10:00:41Z aedon.locean-ipsl.upmc.fr (Darwin) 38 # http://forge.ipsl.jussieu.fr/saxo/download/ is the new directory reference 39 # for tar file instead of ~/SAXO_SRC/ ie home of Sebatien Masson on 40 # arete.locean-ipsl.jussieu.fr 41 # !!! saxo@forge.ipsl.jussieu.fr password is needed 42 # fplod 2006-05-31T10:34:18Z aedon.locean-ipsl.upmc.fr (Darwin) 43 # . add creation of all_plots.html using firststeps.html 44 # . remplace ~/SAXO_SRC/SRC/Documentation/xmldoc/figpng by ./figpng/ 45 # we suppose that this shell script is launched when we are in 46 # <working space of saxo>/SRC/Documentation/xmldoc/ 8 # fplod 2008-04-15T10:53:26Z aedon.locean-ipsl.upmc.fr (Darwin) 9 # creation from makehtml.sh 10 # adapation to docbook 5.0 47 11 # 48 12 set -u 13 set -o posix 49 14 # 50 case $( whoami ) in51 smasson)52 lgforge=smasson53 ;;54 floseb)55 lgforge=smasson56 ;;57 *)58 lgforge=saxo59 ;;60 esac61 #62 case "${1}" in63 getsaxo)64 # size of SRC and DATA with .svn65 szallsvn=$( du -sh ../../.. | awk '{print $1}' )66 szallsvn=${szallsvn%*M}67 # size of SRC with .svn68 szsrcsvn=$( du -sh ../../../SRC | awk '{print $1}' )69 szsrcsvn=${szsrcsvn%*M}70 # size of DATA with .svn71 szdatasvn=$( du -sh ../../../DATA | awk '{print $1}' )72 szdatasvn=${szdatasvn%*M}73 echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times"74 # find the most recent SAXO_SRC_yyyymmddrxxx.tar.gz in75 # /ipsl/forge/projets/saxo/download/76 infosrc=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz | head -n 1)77 filesrc=$(echo ${infosrc} | awk '{print $NF}')78 szsrc=$(echo ${infosrc} | awk '{print $5}')79 # ndate is the date in the file SAXO_SRC_*.tar.gz80 ndate=${filesrc##*_}81 ndate=${ndate%.tar.gz}82 # find the most recent SAXO_DATA_yyyymmddrxxx.tar.gz in83 # /ipsl/forge/projets/saxo/download/84 infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1)85 filedata=$(echo ${infodata} | awk '{print $NF}')86 szdata=$(echo ${infodata} | awk '{print $5}')87 # ndate2 is the date in the file SAXO_DATA_*.tar.gz88 ndate2=${filedata##*_}89 ndate2=${ndate2%.tar.gz}90 ;;91 infoupdatekwd)92 grep "^ old = \[old, .* new = \[new" ../../ForOldVersion/updatekwd.pro | \93 sort | \94 sed -e "s/\( old = \[old, '\)\(.*\)\('\] *& new = \[new, '\)\(.*\)\('\]\)/<row><entry colname='old'><varname>\2<\/varname><\/entry> <entry colname='new'><varname>\4<\/varname><\/entry><\/row>/" > /tmp/rowskwd.xml95 ;;96 infoupdatecm)97 grep "IF NOT key_forgetold AND n_elements(" ../../ForOldVersion/updateold.pro | \98 sort | \99 sed -e "s/\(^.* THEN \)\(.*\)\( = \)\(.*\)/<row><entry colname='old'><varname>\2<\/varname><\/entry> <entry colname='new'><varname>\4<\/varname><\/entry><\/row>/" > /tmp/rowscm.xml100 ;;101 mini_notice)102 # production of images with frames and callouts103 # ./forxxxdoc.sh 0101104 # ./forxxxdoc.sh 0201105 ;;106 *)107 echo "iii : no prerequisites needed"108 ;;109 esac110 111 15 # figures lists 112 16 cd ./figpng 113 114 17 # 115 18 figsplt_lev="" 116 19 for i in tst_plt_lev_[0-9][0-9].png 117 20 do 118 figsplt_lev="${figsplt_lev} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"21 figsplt_lev="${figsplt_lev} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 119 22 done 120 23 figspltz_lev="" 121 24 for i in tst_pltz_lev_[0-9][0-9].png 122 25 do 123 figspltz_lev="${figspltz_lev} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"26 figspltz_lev="${figspltz_lev} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 124 27 done 125 28 figspltt_lev="" 126 29 for i in tst_pltt_lev_[0-9][0-9].png 127 30 do 128 figspltt_lev="${figspltt_lev} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"31 figspltt_lev="${figspltt_lev} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 129 32 done 130 33 # … … 132 35 for i in tst_plt_orca2_[0-9][0-9].png 133 36 do 134 figsplt_orca2="${figsplt_orca2} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"37 figsplt_orca2="${figsplt_orca2} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 135 38 done 136 39 figspltz_orca2="" 137 40 for i in tst_pltz_orca2_[0-9][0-9].png 138 41 do 139 figspltz_orca2="${figspltz_orca2} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"42 figspltz_orca2="${figspltz_orca2} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 140 43 done 141 44 figspltt_orca2="" 142 45 for i in tst_pltt_orca2_[0-9][0-9].png 143 46 do 144 figspltt_orca2="${figspltt_orca2} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"47 figspltt_orca2="${figspltt_orca2} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 145 48 done 146 49 # … … 148 51 for i in tst_plt_orca05_[0-9][0-9].png 149 52 do 150 figsplt_orca05="${figsplt_orca05} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"53 figsplt_orca05="${figsplt_orca05} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 151 54 done 152 55 figspltz_orca05="" 153 56 for i in tst_pltz_orca05_[0-9][0-9].png 154 57 do 155 figspltz_orca05="${figspltz_orca05} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"58 figspltz_orca05="${figspltz_orca05} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 156 59 done 157 60 figspltt_orca05="" 158 61 for i in tst_pltt_orca05_[0-9][0-9].png 159 62 do 160 figspltt_orca05="${figspltt_orca05} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"63 figspltt_orca05="${figspltt_orca05} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 161 64 done 162 65 ## … … 165 68 for i in tst_plt_lev_stride_[0-9][0-9].png 166 69 do 167 figsplt_lev_stride="${figsplt_lev_stride} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"70 figsplt_lev_stride="${figsplt_lev_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 168 71 done 169 72 figspltz_lev_stride="" 170 73 for i in tst_pltz_lev_stride_[0-9][0-9].png 171 74 do 172 figspltz_lev_stride="${figspltz_lev_stride} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"75 figspltz_lev_stride="${figspltz_lev_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 173 76 done 174 77 figspltt_lev_stride="" 175 78 for i in tst_pltt_lev_stride_[0-9][0-9].png 176 79 do 177 figspltt_lev_stride="${figspltt_lev_stride} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"80 figspltt_lev_stride="${figspltt_lev_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 178 81 done 179 82 # … … 181 84 for i in tst_plt_orca2_stride_[0-9][0-9].png 182 85 do 183 figsplt_orca2_stride="${figsplt_orca2_stride} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"86 figsplt_orca2_stride="${figsplt_orca2_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 184 87 done 185 88 figspltz_orca2_stride="" 186 89 for i in tst_pltz_orca2_stride_[0-9][0-9].png 187 90 do 188 figspltz_orca2_stride="${figspltz_orca2_stride} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"91 figspltz_orca2_stride="${figspltz_orca2_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 189 92 done 190 93 figspltt_orca2_stride="" 191 94 for i in tst_pltt_orca2_stride_[0-9][0-9].png 192 95 do 193 figspltt_orca2_stride="${figspltt_orca2_stride} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"96 figspltt_orca2_stride="${figspltt_orca2_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 194 97 done 195 98 # … … 197 100 for i in tst_plt_orca05_stride_[0-9][0-9].png 198 101 do 199 figsplt_orca05_stride="${figsplt_orca05_stride} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"102 figsplt_orca05_stride="${figsplt_orca05_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 200 103 done 201 104 figspltz_orca05_stride="" 202 105 for i in tst_pltz_orca05_stride_[0-9][0-9].png 203 106 do 204 figspltz_orca05_stride="${figspltz_orca05_stride} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"107 figspltz_orca05_stride="${figspltz_orca05_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 205 108 done 206 109 figspltt_orca05_stride="" 207 110 for i in tst_pltt_orca05_stride_[0-9][0-9].png 208 111 do 209 figspltt_orca05_stride="${figspltt_orca05_stride} \< ulink url=\"figpng\/${i}\"\>\&showfig\;\<\/ulink\>"112 figspltt_orca05_stride="${figspltt_orca05_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>" 210 113 done 211 114 ## 212 115 cd .. # ie <working space of saxo>/SRC/Documentation/xmldoc 213 116 # 214 # production of titlepage.saxo.xsl 215 # 216 # si pb reseau remplacer sur mac par la ligne suivante 217 titlepagexsl=http://docbook.sourceforge.net/release/xsl/current/template/titlepage.xsl 218 titlepagexsl=/sw/share/xml/xsl/docbook-xsl/template/titlepage.xsl 219 # 220 xsltproc \ 221 --xinclude \ 222 -o titlepage.saxo.xsl \ 223 ${titlepagexsl} \ 224 titlepage.saxo.xml 225 status=${?} 226 if [ ${status} -ne 0 ] 227 then 228 echo "eee : pb xsltproc sur titlepage.saxo.xml" 229 exit 1 230 fi 231 # 232 case "${1}" in 233 getsaxo) 234 sed -e s/"\&date\;"/${ndate}/g \ 235 -e s/"\&date2\;"/${ndate2}/g \ 236 -e s/"\&szsrc\;"/${szsrc}/g \ 237 -e s/"\&szdata\;"/${szdata}/g \ 238 -e s/"\&szallsvn\;"/${szallsvn}/g \ 239 -e s/"\&szsrcsvn\;"/${szsrcsvn}/g \ 240 -e s/"\&szdatasvn\;"/${szdatasvn}/g \ 241 ${1}.xml > ${1}_${$}.xml 242 ;; 243 firststeps) 244 sed -e s/"\&figsplt_lev\;"/"${figsplt_lev}"/g \ 245 -e s/"\&figsplt_orca2\;"/"${figsplt_orca2}"/g \ 246 -e s/"\&figsplt_orca05\;"/"${figsplt_orca05}"/g \ 247 -e s/"\&figspltz_lev\;"/"${figspltz_lev}"/g \ 248 -e s/"\&figspltz_orca2\;"/"${figspltz_orca2}"/g \ 249 -e s/"\&figspltz_orca05\;"/"${figspltz_orca05}"/g \ 250 -e s/"\&figspltt_lev\;"/"${figspltt_lev}"/g \ 251 -e s/"\&figspltt_orca2\;"/"${figspltt_orca2}"/g \ 252 -e s/"\&figspltt_orca05\;"/"${figspltt_orca05}"/g \ 253 -e s/"\&figsplt_lev_stride\;"/"${figsplt_lev_stride}"/g \ 254 -e s/"\&figsplt_orca2_stride\;"/"${figsplt_orca2_stride}"/g \ 255 -e s/"\&figsplt_orca05_stride\;"/"${figsplt_orca05_stride}"/g \ 256 -e s/"\&figspltz_lev_stride\;"/"${figspltz_lev_stride}"/g \ 257 -e s/"\&figspltz_orca2_stride\;"/"${figspltz_orca2_stride}"/g \ 258 -e s/"\&figspltz_orca05_stride\;"/"${figspltz_orca05_stride}"/g \ 259 -e s/"\&figspltt_lev_stride\;"/"${figspltt_lev_stride}"/g \ 260 -e s/"\&figspltt_orca2_stride\;"/"${figspltt_orca2_stride}"/g \ 261 -e s/"\&figspltt_orca05_stride\;"/"${figspltt_orca05_stride}"/g \ 262 ${1}.xml > ${1}_${$}.xml 263 ;; 264 infoupdatekwd) 265 sed -e "/-- rows from updatekwd.pro --/r /tmp/rowskwd.xml" \ 266 ${1}.xml > ${1}_${$}.xml 267 /bin/rm /tmp/rowskwd.xml 268 ;; 269 infoupdatecm) 270 sed -e "/-- rows from updateold.pro --/r /tmp/rowscm.xml" \ 271 ${1}.xml > ${1}_${$}.xml 272 /bin/rm /tmp/rowscm.xml 273 ;; 274 faqsaxo|websaxo) 275 # resolve xinclude 276 xmllint --xinclude \ 277 --output ${1}_${$}.xml ${1}.xml 278 status=${?} 279 if [ ${status} -ne 0 ] 280 then 281 echo "eee : pb xmllint sur ${1}.xml" 282 exit 1 283 fi 284 ;; 285 *) 286 cp ${1}.xml ${1}_${$}.xml 287 echo "iii : no xml transformation needed" 288 ;; 289 esac 290 # 291 CLASSPATH=${CLASSPATH}:/usr/Xalan/xalan.jar:/usr/Xalan/xml-apis.jar:\ 292 /usr/Xalan/xercesImpl.jar:/usr/docbook-xsl/extensions/xalan25.jar 293 export CLASSPATH 294 # 295 java org.apache.xalan.xslt.Process -out ${1}.html -in ${1}_${$}.xml \ 296 -xsl saxo_html.xsl \ 297 -param section.autolabel 1 \ 298 -param html.stylesheet "style.css saxo.css" \ 299 -param css.decoration 1 300 status=${?} 301 if [ ${status} -ne 0 ] 302 then 303 echo "eee : pb xalan sur ${1}_${$}.xml" 304 exit 1 305 fi 306 # 307 case "${1}" in 308 firststeps) 309 # process all_plots 310 java org.apache.xalan.xslt.Process -out all_plots_${$}.xml \ 311 -in ${1}_${$}.xml \ 312 -xsl all_plots_docbook.xsl 313 java org.apache.xalan.xslt.Process -out all_plots.html \ 314 -in all_plots_${$}.xml \ 315 -xsl saxo_html.xsl \ 316 -param section.autolabel 1 \ 317 -param html.stylesheet "style.css saxo.css" \ 318 -param css.decoration 1 319 rm -f all_plots_${$}.xml 320 ;; 321 websaxo) 322 sed -e s?"../../saxo/browser/trunk/SRC/Documentation/xmldoc/"??g \ 323 -e s?"../../saxo/browser/trunk/SRC/Documentation/idldoc_html_output/"?"../idldoc_html_output/"?g \ 324 -e s?"../../saxo/browser/trunk"?"http://forge.ipsl.jussieu.fr/saxo/browser/trunk"?g \ 325 ${1}.html > ${1}_${$}.html 326 mv ${1}_${$}.html ${1}.html 327 ;; 328 esac 329 # 330 # use of tidy to have a W3C compliant html file 331 tidy -m ${1}.html 332 # 333 # clean 334 rm -f ${1}_${$}.xml 335 rm titlepage.saxo.xsl 117 rm firststeps_sed.xml 2> /dev/null 118 sed -e s/"\&figsplt_lev\;"/"${figsplt_lev}"/g \ 119 -e s/"\&figsplt_orca2\;"/"${figsplt_orca2}"/g \ 120 -e s/"\&figsplt_orca05\;"/"${figsplt_orca05}"/g \ 121 -e s/"\&figspltz_lev\;"/"${figspltz_lev}"/g \ 122 -e s/"\&figspltz_orca2\;"/"${figspltz_orca2}"/g \ 123 -e s/"\&figspltz_orca05\;"/"${figspltz_orca05}"/g \ 124 -e s/"\&figspltt_lev\;"/"${figspltt_lev}"/g \ 125 -e s/"\&figspltt_orca2\;"/"${figspltt_orca2}"/g \ 126 -e s/"\&figspltt_orca05\;"/"${figspltt_orca05}"/g \ 127 -e s/"\&figsplt_lev_stride\;"/"${figsplt_lev_stride}"/g \ 128 -e s/"\&figsplt_orca2_stride\;"/"${figsplt_orca2_stride}"/g \ 129 -e s/"\&figsplt_orca05_stride\;"/"${figsplt_orca05_stride}"/g \ 130 -e s/"\&figspltz_lev_stride\;"/"${figspltz_lev_stride}"/g \ 131 -e s/"\&figspltz_orca2_stride\;"/"${figspltz_orca2_stride}"/g \ 132 -e s/"\&figspltz_orca05_stride\;"/"${figspltz_orca05_stride}"/g \ 133 -e s/"\&figspltt_lev_stride\;"/"${figspltt_lev_stride}"/g \ 134 -e s/"\&figspltt_orca2_stride\;"/"${figspltt_orca2_stride}"/g \ 135 -e s/"\&figspltt_orca05_stride\;"/"${figspltt_orca05_stride}"/g \ 136 firststeps.xml > firststeps_sed.xml 336 137 # 337 138 # exit
Note: See TracChangeset
for help on using the changeset viewer.