Changeset 413


Ignore:
Timestamp:
11/12/09 10:50:27 (15 years ago)
Author:
pinsard
Message:

doidldoc.sh ok for HTML

Location:
trunk/SRC/Documentation/xmldoc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Documentation/xmldoc/doidldoc.sh

    r412 r413  
    11#! /bin/sh 
    2 # 
    32#+ 
    43# 
     
    1110# ======== 
    1211# 
    13 # ``doidldoc.sh -i indir -t title -o outdir -idldoc_version idldoc_version -idldoc_dir idldoc_dir`` 
     12# ``doidldoc.sh -i indir -t title -o outdir -idl_dir idl_dir -idldoc_version idldoc_version -idldoc_dir idldoc_dir`` 
    1413# 
    1514# DESCRIPTION 
     
    6160# :: 
    6261# 
    63 # $ cd SAXO_ws/SRC/Documentation/xmldoc/ 
    64 # $ ${SAXO_DIR}/SRC/Documentation/xmldoc/doidldoc.sh -i ../.. -t "SAXO Documentation" -o ./idldoc_html_output/ 
     62# $ cd SAXO_DIR_ws/SRC/Documentation/xmldoc/ 
     63# $ ${SAXO_DIR}/SRC/Documentation/xmldoc/doidldoc.sh -i ../.. -t "SAXO Documentation" -o ./idldoc_html_output/ -idl_dir /usr/local_linux/idl/idl_6.4/idl/ 
    6564# 
    6665# To produce VARAMMA HTML outputs : 
     
    6867# 
    6968# $ cd /usr/home/fplod/incas/varamma/varamma_ws/ 
    70 # $ ${SAXO_DIR}/SRC/Documentation/xmldoc/doidldoc.sh -i . -t "VARAMMA Documentation" -o /tmp/idldoc_html_output/ 
    71 # 
     69# $ ${SAXO_DIR}/SRC/Documentation/xmldoc/doidldoc.sh -i . -t "VARAMMA Documentation" -o /tmp/idldoc_html_output/ -idl_dir /usr/local_linux/idl/idl_6.4/idl/ 
     70# 
     71# To produce POST_IT HTML outputs : 
     72# :: 
     73# 
     74# $ cd /usr/home/fplod/incas/post_it/post_it_ws/ 
     75# $ ${SAXO_DIR}/SRC/Documentation/xmldoc/doidldoc.sh -i . -t "POST_IT/Documentation" -o /tmp/idldoc_html_output/ -idl_dir /usr/local_linux/idl/idl_6.4/idl/ 
     76# 
     77 
    7278# TODO 
    7379# ==== 
    7480# 
    75 # ++ pb PATH introduire SAXO_PATH 
    76 # can be solved with: 
    77 # :: 
    78 # 
    79 # $ export PATH=${HOME}/SAXO_DIR/SRC/Documentation/xmldoc/:${PATH} 
    80 # 
    81 # ++ pb avec IDL_DIR pas tjs positionné 
    82 # can be solved for linux with 
    83 # :: 
    84 # 
    85 # $ export IDL_DIR=/usr/local_linux/idl/ 
    86 # 
    87 # or for MacOSX with 
    88 # :: 
    89 # 
    90 # $ export IDL_DIR=/usr/local_macosx/idl//idl_6.2/idl_6.2/ 
    91 # 
    92 # 
    9381# ++ choix de la version de idldoc et consequences sur assistant 
    9482# 
     
    10593# 
    10694# $Id$ 
     95# 
     96# - fplod 20091112T084225Z aedon.locean-ipsl.upmc.fr (Darwin) 
     97# 
     98#   * bug fix if indir is set to '.' 
     99#   * idl_dir in parameter 
     100#   * path of local commands 
    107101# 
    108102# - fplod 20091110T151839Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    196190idldoc_version="2.0" 
    197191unset command_dir 
    198  
     192# default IDL command and directory 
     193#idl_dir=/usr/local_linux/idl/idl64/  # overriding idl_dir for test ++ 
    199194#idldoc_dir="/usr/home/fplod/src/idldoc-3.1.1/" # overriding idldoc_dir for test ++ 
    200195# 
    201 minargcount=4 
     196minargcount=6 
    202197if [ ${#} -lt ${minargcount} ] 
    203198then 
     
    213208 indir=${2} 
    214209 shift 
     210 case ${indir} in 
     211 .) 
     212  indir=$(pwd) 
     213  ;; 
     214 esac 
    215215 ;; 
    216216 -t) 
     
    228228 -idldoc_version) 
    229229 idldoc_version=${2} 
     230 shift 
     231 ;; 
     232 -idl_dir) 
     233 idl_dir=${2} 
    230234 shift 
    231235 ;; 
     
    283287 ;; 
    284288esac 
     289# 
    285290# launch IDL with the file built above 
    286291export IDL_STARTUP=${pro} 
     
    366371# replace <pro>ginette</pro> by a sequence like 
    367372# <a href="./ginette.html">ginette</a> 
    368 pro2href.sh -i ${outputtmp} -r ${outputtmp} -e pro 
     373${SAXO_DIR}/SRC/Documentation/xmldoc/pro2href.sh -i ${outputtmp} -r ${outputtmp} -e pro 
    369374status=${?} 
    370375if [ ${status} -ne 0 ] 
     
    375380# replace <proidl>ginette</proidl> by a sequence like 
    376381# <a href="./ginette.html">ginette</a> 
    377 pro2href.sh -i ${outputtmp} -r ${IDL_DIR}/help/online_help -e proidl 
     382${SAXO_DIR}/SRC/Documentation/xmldoc/pro2href.sh -i ${outputtmp} -r ${idl_dir}/help/online_help -e proidl 
    378383status=${?} 
    379384if [ ${status} -ne 0 ] 
     
    411416read a 
    412417# launch IDL with the file built above 
    413 IDL_STARTUP=${pro};${IDL_DIR}/bin/idl 
     418IDL_STARTUP=${pro};${idl_dir}/bin/idl 
    414419/bin/rm ${pro} 
    415420# In order to do not have to many revision in svn, we modify some 
     
    461466# replace <pro>ginette</pro> by a sequence like 
    462467# <a href="./ginette.html">ginette</a> 
    463 pro2href.sh -i ${outputtmp} -r ${outputtmp} -e pro 
     468${SAXO_DIR}/SRC/Documentation/xmldoc/pro2href.sh -i ${outputtmp} -r ${outputtmp} -e pro 
    464469status=${?} 
    465470if [ ${status} -ne 0 ] 
     
    470475# replace <proidl>ginette</proidl> by a sequence like 
    471476# <a href="./ginette.html">ginette</a> 
    472 pro2href.sh -i ${outputtmp} -r ${IDL_DIR}/help/online_help -e proidl 
     477${SAXO_DIR}/SRC/Documentation/xmldoc/pro2href.sh -i ${outputtmp} -r ${idl_dir}/help/online_help -e proidl 
    473478status=${?} 
    474479if [ ${status} -ne 0 ] 
     
    503508 if [ ${nhtml} -ne 2 ] 
    504509         then 
    505          echo "ERROR there is not 2 $( basename ${i} .pro ).html files" 
     510         echo "ERROR there is no 2 $( basename ${i} .pro ).html files" 
    506511         find ../.. -name $( basename ${i} .pro ).html 
    507512         echo 
  • trunk/SRC/Documentation/xmldoc/savesaxo.sh

    r411 r413  
    11#!/bin/bash 
    22# 
    3 # update : 
     3# 
     4# TODO 
     5# ==== 
     6# 
     7# use doidldoc.sh for assistant outputs 
     8# 
     9# EVOLUTIONS 
     10# ========== 
     11# 
    412# $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# 
    519# fplod 2008-04-28T08:40:23Z aedon.locean-ipsl.upmc.fr (Darwin) 
    620# add wiki update 
     
    108122set -u 
    109123# 
     124# define idl_dir 
     125# reference is idl 64 on zeus.locean-ipsl.upmc.fr 
     126idl_dir=/usr/local_linux/idl/idl_6.4/idl/ 
     127# 
    110128docompileall=0 
    111129dohtml=0 
     
    113131dooldtest=0 
    114132doidlwavedoc=0 
    115 doidldoc=0 
     133doidldoc=1 
    116134doTARsrc=0 
    117135doTARdata=0 
     
    192210    echo "exit" >> /tmp/compileall${$}.pro 
    193211    IDL_STARTUP=/tmp/compileall${$}.pro 
    194     ${IDL_DIR}/bin/idl &> /tmp/compileallerr_${$} 
     212    ${idl_dir}/bin/idl &> /tmp/compileallerr_${$} 
    195213    echo 
    196214    echo 
     
    253271then 
    254272# 
    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} 
    381278# 
    382279    # build a idl file to launch idldoc 
     
    393290EOF 
    394291    # launch idl with the file built above 
    395     IDL_STARTUP=${pro};${IDL_DIR}/bin/idl 
     292    IDL_STARTUP=${pro};${idl_dir}/bin/idl 
    396293    /bin/rm ${pro} 
    397294    # In order to do not have to many revision in svn, we modify some 
     
    452349    # replace <proidl>ginette</proidl> by a sequence like 
    453350    # <a href="./ginette.html">ginette</a> 
    454     ./pro2href.sh  -i ${output} -r ${IDL_DIR}/help/online_help -e proidl 
     351    ./pro2href.sh  -i ${output} -r ${idl_dir}/help/online_help -e proidl 
    455352    status=${?} 
    456353    if [ ${status} -ne 0 ] 
     
    487384      if [ ${nhtml} -ne 2 ] 
    488385          then 
    489           echo "ERROR there is not 2 $( basename ${i} .pro ).html files" 
     386          echo "ERROR there is no 2 $( basename ${i} .pro ).html files" 
    490387          find ../.. -name $( basename ${i} .pro ).html 
    491388          echo 
Note: See TracChangeset for help on using the changeset viewer.