Changeset 413 for trunk/SRC/Documentation/xmldoc/savesaxo.sh
- Timestamp:
- 11/12/09 10:50:27 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/xmldoc/savesaxo.sh
r411 r413 1 1 #!/bin/bash 2 2 # 3 # update : 3 # 4 # TODO 5 # ==== 6 # 7 # use doidldoc.sh for assistant outputs 8 # 9 # EVOLUTIONS 10 # ========== 11 # 4 12 # $Id$ 13 # 14 # - fplod 20091112T091437Z aedon.locean-ipsl.upmc.fr (Darwin) 15 # 16 # * define idl_dir (ref = idl6.4 on zeus) 17 # * use doidldoc.sh for HTML outputs 18 # 5 19 # fplod 2008-04-28T08:40:23Z aedon.locean-ipsl.upmc.fr (Darwin) 6 20 # add wiki update … … 108 122 set -u 109 123 # 124 # define idl_dir 125 # reference is idl 64 on zeus.locean-ipsl.upmc.fr 126 idl_dir=/usr/local_linux/idl/idl_6.4/idl/ 127 # 110 128 docompileall=0 111 129 dohtml=0 … … 113 131 dooldtest=0 114 132 doidlwavedoc=0 115 doidldoc= 0133 doidldoc=1 116 134 doTARsrc=0 117 135 doTARdata=0 … … 192 210 echo "exit" >> /tmp/compileall${$}.pro 193 211 IDL_STARTUP=/tmp/compileall${$}.pro 194 ${ IDL_DIR}/bin/idl &> /tmp/compileallerr_${$}212 ${idl_dir}/bin/idl &> /tmp/compileallerr_${$} 195 213 echo 196 214 echo … … 253 271 then 254 272 # 255 # build a idl file to launch idldoc 256 output=../idldoc_html_output/ 257 log="/tmp/idldochtml_${$}.log" 258 pro="/tmp/idldochtml_${$}.pro" 259 cat <<EOF > ${pro} 260 !path = expand_path('+' + '../idldoc/') 261 print,!path 262 idldoc,root="../../",title="SAXO Documentation", $ 263 LOG_FILE="${log}", $ 264 output="${output}", $ 265 overview="../../overview", /statistics, /preformat 266 exit 267 EOF 268 # launch idl with the file built above 269 IDL_STARTUP=${pro};${IDL_DIR}/bin/idl 270 /bin/rm ${pro} 271 # In order to do not have to many revision in svn, we modify some 272 # lines produced by idldoc : 273 # - add Source link in each html file corresponding to a .pro file 274 # example : 275 # <td>Source</td> 276 # will be replaced by 277 # <td><a href="../../Calendar/caldat.pro" title="Source code of a file">Source</a></td> 278 # 279 # - remove date and time of idldoc production 280 # examples : 281 # <!-- Generated by IDLdoc 2.0 on Wed Jun 7 10:25:28 2006 --> 282 # will be replaced by 283 # <!-- Generated by IDLdoc 2.0 --> 284 # <div id="tagline">Produced by IDLdoc 2.0 on Wed Jun 7 10:54:37 2006.</div 285 # will be replaced by 286 # <div id="tagline">Produced by IDLdoc 2.0</div> 287 # <h2>Produced on Wed Jun 7 10:23:13 2006</h2> 288 # will be delete 289 # other lines will be deleted because the time is the time of checkout not 290 # the time of revision. 291 # the sequence of lines 292 #<dl> 293 # <dt>Last modification:</dt> 294 # <dd>Fri Jun 2 11:46:24 2006</dd> 295 # </dl> 296 # should also be removed ++ je ne sais pas dire en sed la ligne 297 # suivant l'occurence de Last modification 298 # 299 # count of directory levels in output 300 # this count will be use to format relative path later 301 nblev1=$(echo ${output} | sed -e "s@/\$@@" |awk -F "/" '{print NF}') 302 # 303 list_html_pro=$(find ${output} -name "*.html" -exec grep -l "<title>.*\.pro" {} \;) 304 for file_html in ${list_html_pro} 305 do 306 # build the .pro file name 307 bfile=$(basename ${file_html} .html) 308 # retrieve the path of html file relative to memopwd (so relative to 309 # output). This path will be used in "Source" link. 310 nblev2=$(dirname ${file_html} | sed -e "s@/\$@@" | awk -F "/" '{print NF}') 311 difflev=$((${nblev2} - ${nblev1})) 312 if [ ${difflev} -ge 2 ] 313 then 314 ilev=1 315 reloutput_html=".." 316 while [ ${ilev} -le ${difflev} ] 317 do 318 reloutput_html="${reloutput_html}/.." 319 ilev=$(( ${ilev} + 1 )) 320 done 321 relpath_html=$(dirname ${file_html} | \ 322 sed -e "s@${output}@${reloutput_html}@" \ 323 -e "s@\$@/@") 324 # echo "relpath ${relpath_html})" 325 else 326 relpath_html="./" 327 fi 328 # echo "relpath ${relpath_html}/${bfile}" 329 sed \ 330 -e "s@<td >Source<\/td>@<td><a href=\"${relpath_html}/${bfile}.pro\" title=\"Source code of a file\">Source<\/a><\/td>@" \ 331 ${file_html} > ${file_html}_modify 332 mv ${file_html}_modify ${file_html} 333 done 334 list_html=$(find ${output} -name "*.html") 335 for file_html in ${list_html} 336 do 337 sed \ 338 -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \ 339 -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/div>\)/\1\3/" \ 340 -e "/<h2>Produced on/d" \ 341 -e "/Last modification:/d" \ 342 -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \ 343 -e 's@<div class="value">@<div class="preformat">@' \ 344 -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \ 345 -e 's@^ <fixe>@<pre>@' \ 346 -e 's@^ </fixe>@</pre>@' \ 347 -e 's@xhtml-transitional@xhtml1-transitional@' \ 348 ${file_html} > ${file_html}_modify 349 mv ${file_html}_modify ${file_html} 350 done 351 # suppress ".html" in idldoc-index*.html in lines like 352 # a parameter from the routine ./ReadWrite/idl-NetCDF/ncdf_read.html 353 list_html=$(find ${output} -name "idldoc-index*.html") 354 for file_html in ${list_html} 355 do 356 sed \ 357 -e "s/\(a parameter from the routine \)\(.*\)\(.html\)/\1\2/" \ 358 ${file_html} > ${file_html}_modify 359 mv ${file_html}_modify ${file_html} 360 done 361 # replace <pro>ginette</pro> by a sequence like 362 # <a href="./ginette.html">ginette</a> 363 ./pro2href.sh -i ${output} -r ${output} -e pro 364 status=${?} 365 if [ ${status} -ne 0 ] 366 then 367 echo "eee : pb during ./pro2href.sh for <pro>...</pro>" 368 exit 1 369 fi 370 # replace <proidl>ginette</proidl> by a sequence like 371 # <a href="./ginette.html">ginette</a> 372 ./pro2href.sh -i ${output} -r ${IDL_DIR}/help/online_help -e proidl 373 status=${?} 374 if [ ${status} -ne 0 ] 375 then 376 echo "eee : pb during ./pro2href.sh for <proidl>...</proidl>" 377 exit 1 378 fi 379 echo "iii : you can see log file in ${log}" 380 echo "iii : and look ${output}/idldoc-warnings.html#undoc" 273 # build HTML idldoc outputs 274 ${SAXO_DIR}/SRC/Documentation/xmldoc/doidldoc.sh \ 275 -i ../.. -t "SAXO Documentation" \ 276 -o ../idldoc_html_output/ 277 -idl_dir ${idl_dir} 381 278 # 382 279 # build a idl file to launch idldoc … … 393 290 EOF 394 291 # launch idl with the file built above 395 IDL_STARTUP=${pro};${ IDL_DIR}/bin/idl292 IDL_STARTUP=${pro};${idl_dir}/bin/idl 396 293 /bin/rm ${pro} 397 294 # In order to do not have to many revision in svn, we modify some … … 452 349 # replace <proidl>ginette</proidl> by a sequence like 453 350 # <a href="./ginette.html">ginette</a> 454 ./pro2href.sh -i ${output} -r ${ IDL_DIR}/help/online_help -e proidl351 ./pro2href.sh -i ${output} -r ${idl_dir}/help/online_help -e proidl 455 352 status=${?} 456 353 if [ ${status} -ne 0 ] … … 487 384 if [ ${nhtml} -ne 2 ] 488 385 then 489 echo "ERROR there is no t2 $( basename ${i} .pro ).html files"386 echo "ERROR there is no 2 $( basename ${i} .pro ).html files" 490 387 find ../.. -name $( basename ${i} .pro ).html 491 388 echo
Note: See TracChangeset
for help on using the changeset viewer.