Index: /trunk/SRC/Documentation/xmldoc/doidldoc.sh
===================================================================
--- /trunk/SRC/Documentation/xmldoc/doidldoc.sh	(revision 412)
+++ /trunk/SRC/Documentation/xmldoc/doidldoc.sh	(revision 413)
@@ -1,4 +1,3 @@
 #! /bin/sh
-#
 #+
 #
@@ -11,5 +10,5 @@
 # ========
 #
-# ``doidldoc.sh -i indir -t title -o outdir -idldoc_version idldoc_version -idldoc_dir idldoc_dir``
+# ``doidldoc.sh -i indir -t title -o outdir -idl_dir idl_dir -idldoc_version idldoc_version -idldoc_dir idldoc_dir``
 #
 # DESCRIPTION
@@ -61,6 +60,6 @@
 # ::
 #
-# $ cd SAXO_ws/SRC/Documentation/xmldoc/
-# $ ${SAXO_DIR}/SRC/Documentation/xmldoc/doidldoc.sh -i ../.. -t "SAXO Documentation" -o ./idldoc_html_output/
+# $ cd SAXO_DIR_ws/SRC/Documentation/xmldoc/
+# $ ${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/
 #
 # To produce VARAMMA HTML outputs :
@@ -68,27 +67,16 @@
 #
 # $ cd /usr/home/fplod/incas/varamma/varamma_ws/
-# $ ${SAXO_DIR}/SRC/Documentation/xmldoc/doidldoc.sh -i . -t "VARAMMA Documentation" -o /tmp/idldoc_html_output/
-#
+# $ ${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/
+#
+# To produce POST_IT HTML outputs :
+# ::
+#
+# $ cd /usr/home/fplod/incas/post_it/post_it_ws/
+# $ ${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/
+#
+
 # TODO
 # ====
 #
-# ++ pb PATH introduire SAXO_PATH
-# can be solved with:
-# ::
-#
-# $ export PATH=${HOME}/SAXO_DIR/SRC/Documentation/xmldoc/:${PATH}
-#
-# ++ pb avec IDL_DIR pas tjs positionné
-# can be solved for linux with
-# ::
-#
-# $ export IDL_DIR=/usr/local_linux/idl/
-#
-# or for MacOSX with
-# ::
-#
-# $ export IDL_DIR=/usr/local_macosx/idl//idl_6.2/idl_6.2/
-#
-#
 # ++ choix de la version de idldoc et consequences sur assistant
 #
@@ -105,4 +93,10 @@
 #
 # $Id$
+#
+# - fplod 20091112T084225Z aedon.locean-ipsl.upmc.fr (Darwin)
+#
+#   * bug fix if indir is set to '.'
+#   * idl_dir in parameter
+#   * path of local commands
 #
 # - fplod 20091110T151839Z aedon.locean-ipsl.upmc.fr (Darwin)
@@ -196,8 +190,9 @@
 idldoc_version="2.0"
 unset command_dir
-
+# default IDL command and directory
+#idl_dir=/usr/local_linux/idl/idl64/  # overriding idl_dir for test ++
 #idldoc_dir="/usr/home/fplod/src/idldoc-3.1.1/" # overriding idldoc_dir for test ++
 #
-minargcount=4
+minargcount=6
 if [ ${#} -lt ${minargcount} ]
 then
@@ -213,4 +208,9 @@
  indir=${2}
  shift
+ case ${indir} in
+ .)
+  indir=$(pwd)
+  ;;
+ esac
  ;;
  -t)
@@ -228,4 +228,8 @@
  -idldoc_version)
  idldoc_version=${2}
+ shift
+ ;;
+ -idl_dir)
+ idl_dir=${2}
  shift
  ;;
@@ -283,4 +287,5 @@
  ;;
 esac
+#
 # launch IDL with the file built above
 export IDL_STARTUP=${pro}
@@ -366,5 +371,5 @@
 # replace <pro>ginette</pro> by a sequence like
 # <a href="./ginette.html">ginette</a>
-pro2href.sh -i ${outputtmp} -r ${outputtmp} -e pro
+${SAXO_DIR}/SRC/Documentation/xmldoc/pro2href.sh -i ${outputtmp} -r ${outputtmp} -e pro
 status=${?}
 if [ ${status} -ne 0 ]
@@ -375,5 +380,5 @@
 # replace <proidl>ginette</proidl> by a sequence like
 # <a href="./ginette.html">ginette</a>
-pro2href.sh -i ${outputtmp} -r ${IDL_DIR}/help/online_help -e proidl
+${SAXO_DIR}/SRC/Documentation/xmldoc/pro2href.sh -i ${outputtmp} -r ${idl_dir}/help/online_help -e proidl
 status=${?}
 if [ ${status} -ne 0 ]
@@ -411,5 +416,5 @@
 read a
 # launch IDL with the file built above
-IDL_STARTUP=${pro};${IDL_DIR}/bin/idl
+IDL_STARTUP=${pro};${idl_dir}/bin/idl
 /bin/rm ${pro}
 # In order to do not have to many revision in svn, we modify some
@@ -461,5 +466,5 @@
 # replace <pro>ginette</pro> by a sequence like
 # <a href="./ginette.html">ginette</a>
-pro2href.sh -i ${outputtmp} -r ${outputtmp} -e pro
+${SAXO_DIR}/SRC/Documentation/xmldoc/pro2href.sh -i ${outputtmp} -r ${outputtmp} -e pro
 status=${?}
 if [ ${status} -ne 0 ]
@@ -470,5 +475,5 @@
 # replace <proidl>ginette</proidl> by a sequence like
 # <a href="./ginette.html">ginette</a>
-pro2href.sh -i ${outputtmp} -r ${IDL_DIR}/help/online_help -e proidl
+${SAXO_DIR}/SRC/Documentation/xmldoc/pro2href.sh -i ${outputtmp} -r ${idl_dir}/help/online_help -e proidl
 status=${?}
 if [ ${status} -ne 0 ]
@@ -503,5 +508,5 @@
  if [ ${nhtml} -ne 2 ]
 	 then
-	 echo "ERROR there is not 2 $( basename ${i} .pro ).html files"
+	 echo "ERROR there is no 2 $( basename ${i} .pro ).html files"
 	 find ../.. -name $( basename ${i} .pro ).html
 	 echo
Index: /trunk/SRC/Documentation/xmldoc/savesaxo.sh
===================================================================
--- /trunk/SRC/Documentation/xmldoc/savesaxo.sh	(revision 412)
+++ /trunk/SRC/Documentation/xmldoc/savesaxo.sh	(revision 413)
@@ -1,6 +1,20 @@
 #!/bin/bash
 #
-# update :
+#
+# TODO
+# ====
+#
+# use doidldoc.sh for assistant outputs
+#
+# EVOLUTIONS
+# ==========
+#
 # $Id$
+#
+# - fplod 20091112T091437Z aedon.locean-ipsl.upmc.fr (Darwin)
+#
+#   * define idl_dir (ref = idl6.4 on zeus)
+#   * use doidldoc.sh for HTML outputs
+#
 # fplod 2008-04-28T08:40:23Z aedon.locean-ipsl.upmc.fr (Darwin)
 # add wiki update
@@ -108,4 +122,8 @@
 set -u
 #
+# define idl_dir
+# reference is idl 64 on zeus.locean-ipsl.upmc.fr
+idl_dir=/usr/local_linux/idl/idl_6.4/idl/
+#
 docompileall=0
 dohtml=0
@@ -113,5 +131,5 @@
 dooldtest=0
 doidlwavedoc=0
-doidldoc=0
+doidldoc=1
 doTARsrc=0
 doTARdata=0
@@ -192,5 +210,5 @@
     echo "exit" >> /tmp/compileall${$}.pro
     IDL_STARTUP=/tmp/compileall${$}.pro
-    ${IDL_DIR}/bin/idl &> /tmp/compileallerr_${$}
+    ${idl_dir}/bin/idl &> /tmp/compileallerr_${$}
     echo
     echo
@@ -253,130 +271,9 @@
 then
 #
-    # build a idl file to launch idldoc
-    output=../idldoc_html_output/
-    log="/tmp/idldochtml_${$}.log"
-    pro="/tmp/idldochtml_${$}.pro"
-    cat <<EOF > ${pro}
-!path = expand_path('+' + '../idldoc/')
-print,!path
-idldoc,root="../../",title="SAXO Documentation", $
-LOG_FILE="${log}", $
-output="${output}", $
-overview="../../overview", /statistics, /preformat
-exit
-EOF
-    # launch idl with the file built above
-    IDL_STARTUP=${pro};${IDL_DIR}/bin/idl
-    /bin/rm ${pro}
-    # In order to do not have to many revision in svn, we modify some
-    # lines produced by idldoc :
-    # - add Source link in each html file corresponding to a .pro file
-    # example :
-    # <td>Source</td>
-    # will be replaced by
-    # <td><a href="../../Calendar/caldat.pro" title="Source code of a file">Source</a></td>
-    #
-    # - remove date and time of idldoc production
-    # examples :
-    # <!-- Generated by IDLdoc 2.0 on Wed Jun  7 10:25:28 2006 -->
-    # will be replaced by
-    # <!-- Generated by IDLdoc 2.0 -->
-    # <div id="tagline">Produced by IDLdoc 2.0 on Wed Jun  7 10:54:37 2006.</div
-    # will be replaced by
-    # <div id="tagline">Produced by IDLdoc 2.0</div>
-    # <h2>Produced on Wed Jun  7 10:23:13 2006</h2>
-    # will be delete
-    # other lines will be deleted because the time is the time of checkout not
-    # the time of revision.
-    # the sequence of lines
-    #<dl>
-    #      <dt>Last modification:</dt>
-    #       <dd>Fri Jun  2 11:46:24 2006</dd>
-    #    </dl>
-    # should also be removed ++ je ne sais pas dire en sed la ligne
-    # suivant l'occurence de Last modification
-    #
-    # count of directory levels in output
-    # this count will be use to format relative path later
-    nblev1=$(echo ${output} | sed -e "s@/\$@@" |awk -F "/" '{print NF}')
-    #
-    list_html_pro=$(find ${output} -name "*.html" -exec grep -l "<title>.*\.pro" {} \;)
-    for file_html in ${list_html_pro}
-    do
-     # build the .pro file name
-     bfile=$(basename ${file_html} .html)
-     # retrieve the path of html file relative to memopwd (so relative to
-     # output). This path will be used in "Source" link.
-     nblev2=$(dirname ${file_html} |  sed -e "s@/\$@@" | awk -F "/" '{print NF}')
-     difflev=$((${nblev2} - ${nblev1}))
-     if [ ${difflev} -ge 2 ]
-     then
-      ilev=1
-      reloutput_html=".."
-      while [ ${ilev} -le ${difflev} ]
-      do
-       reloutput_html="${reloutput_html}/.."
-       ilev=$(( ${ilev} + 1 ))
-      done
-      relpath_html=$(dirname ${file_html} | \
-                   sed -e "s@${output}@${reloutput_html}@" \
-                       -e "s@\$@/@")
-      # echo "relpath ${relpath_html})"
-     else
-      relpath_html="./"
-     fi
-     # echo "relpath ${relpath_html}/${bfile}"
-     sed \
-     -e "s@<td >Source<\/td>@<td><a href=\"${relpath_html}/${bfile}.pro\" title=\"Source code of a file\">Source<\/a><\/td>@" \
-     ${file_html} > ${file_html}_modify
-     mv ${file_html}_modify ${file_html}
-    done
-    list_html=$(find ${output} -name "*.html")
-    for file_html in ${list_html}
-    do
-     sed \
-     -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \
-     -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/div>\)/\1\3/" \
-     -e "/<h2>Produced on/d" \
-     -e "/Last modification:/d" \
-     -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \
-     -e 's@<div class="value">@<div class="preformat">@' \
-     -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \
-     -e 's@^ <fixe>@<pre>@' \
-     -e 's@^ </fixe>@</pre>@' \
-     -e 's@xhtml-transitional@xhtml1-transitional@' \
-     ${file_html} > ${file_html}_modify
-     mv ${file_html}_modify ${file_html}
-    done
-    # suppress ".html" in idldoc-index*.html in lines like
-    # a parameter from the routine ./ReadWrite/idl-NetCDF/ncdf_read.html
-    list_html=$(find ${output} -name "idldoc-index*.html")
-    for file_html in ${list_html}
-    do
-     sed \
-     -e "s/\(a parameter from the routine \)\(.*\)\(.html\)/\1\2/" \
-     ${file_html} > ${file_html}_modify
-     mv ${file_html}_modify ${file_html}
-    done
-    # replace <pro>ginette</pro> by a sequence like
-    # <a href="./ginette.html">ginette</a>
-    ./pro2href.sh -i ${output} -r ${output} -e pro
-    status=${?}
-    if [ ${status} -ne 0 ]
-    then
-       echo "eee : pb during ./pro2href.sh for <pro>...</pro>"
-       exit 1
-    fi
-    # replace <proidl>ginette</proidl> by a sequence like
-    # <a href="./ginette.html">ginette</a>
-    ./pro2href.sh -i ${output} -r ${IDL_DIR}/help/online_help -e proidl
-    status=${?}
-    if [ ${status} -ne 0 ]
-    then
-       echo "eee : pb during ./pro2href.sh for <proidl>...</proidl>"
-       exit 1
-    fi
-    echo "iii : you can see log file in ${log}"
-    echo "iii : and look ${output}/idldoc-warnings.html#undoc"
+    # build HTML idldoc outputs
+    ${SAXO_DIR}/SRC/Documentation/xmldoc/doidldoc.sh \
+    -i ../.. -t "SAXO Documentation" \
+    -o ../idldoc_html_output/ 
+    -idl_dir ${idl_dir}
 #
     # build a idl file to launch idldoc
@@ -393,5 +290,5 @@
 EOF
     # launch idl with the file built above
-    IDL_STARTUP=${pro};${IDL_DIR}/bin/idl
+    IDL_STARTUP=${pro};${idl_dir}/bin/idl
     /bin/rm ${pro}
     # In order to do not have to many revision in svn, we modify some
@@ -452,5 +349,5 @@
     # replace <proidl>ginette</proidl> by a sequence like
     # <a href="./ginette.html">ginette</a>
-    ./pro2href.sh  -i ${output} -r ${IDL_DIR}/help/online_help -e proidl
+    ./pro2href.sh  -i ${output} -r ${idl_dir}/help/online_help -e proidl
     status=${?}
     if [ ${status} -ne 0 ]
@@ -487,5 +384,5 @@
       if [ ${nhtml} -ne 2 ]
 	  then
-	  echo "ERROR there is not 2 $( basename ${i} .pro ).html files"
+	  echo "ERROR there is no 2 $( basename ${i} .pro ).html files"
 	  find ../.. -name $( basename ${i} .pro ).html
 	  echo
