Index: /trunk/SRC/Colors/xpal.pro
===================================================================
--- /trunk/SRC/Colors/xpal.pro	(revision 232)
+++ /trunk/SRC/Colors/xpal.pro	(revision 233)
@@ -7,5 +7,5 @@
 ; @returns
 ; 1 if the colors changed, 0 otherwise.
-r;
+;
 ; @hidden
 ;
Index: /trunk/SRC/Documentation/xmldoc/pro2href.sh
===================================================================
--- /trunk/SRC/Documentation/xmldoc/pro2href.sh	(revision 233)
+++ /trunk/SRC/Documentation/xmldoc/pro2href.sh	(revision 233)
@@ -0,0 +1,73 @@
+#! /bin/sh
+# replace <pro>ginette</pro> by a sequence like
+# <a href="./ginette.html">ginette</a>
+# we have to deal with the path of ginette.html ...
+#
+# see call in savesaxo.sh
+#
+# update :
+# $Id$
+# fplod 2007-03-20T14:02:14Z aedon.locean-ipsl.upmc.fr (Darwin)
+# creation
+#
+set -u
+output=${1} # ++ parameter
+#
+# first find all files containing <pro>..</pro>
+list_html_pro=$(find ${output} -name "*.html" -exec grep -l "<pro>.*</pro>" {} \;)
+if [ "${list_html_pro}" = " " ]
+then
+   echo "iii : no <pro>..</pro> in html files"
+else
+   for file_html in ${list_html_pro}
+   do
+       fpath=$(dirname ${file_html} | sed -e "s+\(${output}/\)\(.*\)+\2+")
+       list_llink=$(grep -n "<pro>.*</pro>" ${file_html} | awk -F ":" '{print $1}')
+       # ++ repérer si plusieurs <pro>.*</pro> par ligne
+       # ++ sortir en erreur si c'est le cas
+       for line in ${list_llink}
+       do
+          # replace <pro>something</pro> by
+          #<a href="something.html">something</a>
+          # module is the html file name to be used
+          module=$(sed -ne "${line},${line}p" ${file_html} | \
+                   grep "<pro>.*</pro>" | \
+                   sed -e "s+\(.*<pro>\)\(.*\)\(</pro>.*\)+\\2.html+")
+          modulemin=$(echo ${module} | tr "[:upper:]" "[:lower:]" )
+          # lpath is the path on module relatively to the location of
+          # the html file containing the <pro>..</pro>
+          lpath=$(find ${output} -name "${modulemin}")
+           # ++ repérer si doublons 
+           # ++ sortir en erreur si c'est le cas
+          if [ "${lpath}" = "" ]
+          then
+             echo "eee : path of ${modulemin} not found under ${output}"
+             echo "eee : ${module} is used in ${file_html}"
+          else
+             lpath=$(dirname ${lpath} | sed -e "s+\(${output}/\)\(.*\)+\2+")
+#echo "path du fichier html ${fpath}"
+#echo "lpath ${lpath}"
+             if [ "${lpath}" = "${fpath}" ]
+             then
+                relpath="./"
+             else
+                nblev=$(echo ${fpath} |  sed -e "s@/\$@@" | awk -F "/" '{print NF}')
+                nblev=$(( ${nblev} + 1))
+                relpath="./"
+                ilev=1
+                while [ ${ilev} -le ${nblev} ]
+                do
+                   relpath="${relpath}/.."
+                   ilev=$(( ${ilev} + 1 ))
+                done
+                relpath=${relpath}/${lpath}
+             fi
+#echo "relpath ${relpath}"
+             sed -e "${line}s+\(<pro>\)\(.*\)\(</pro>\)+<a href=\"${relpath}/\\2.html\">\2</a>+" \
+             ${file_html} > ${file_html}_modify
+             mv ${file_html}_modify ${file_html}
+          fi
+       done
+   done
+fi
+exit 0
Index: /trunk/SRC/Documentation/xmldoc/savesaxo.sh
===================================================================
--- /trunk/SRC/Documentation/xmldoc/savesaxo.sh	(revision 232)
+++ /trunk/SRC/Documentation/xmldoc/savesaxo.sh	(revision 233)
@@ -3,4 +3,8 @@
 # update :
 # $Id$
+# fplod 2007-03-20T15:10:29Z aedon.locean-ipsl.upmc.fr (Darwin)
+# . replace <pro>ginette</pro> by a sequence like
+# <a href="./ginette.html">ginette</a> in idldoc html and assistant outputs
+# . encaspulate example content in <pre> </pre> in idldoc assistant outputs
 # smasson Fri Sep 22 17:28:10 CEST 2006
 # check that the number of existing html files for each .pro file is 2!
@@ -19,5 +23,5 @@
 # suppress ?format=raw
 # fplod 2006-09-20T15:30:15Z aedon.locean-ipsl.upmc.fr (Darwin)
-# add copy of html files unedr xmldoc and idldoc_htlm_output on
+# add copy of html files unedr xmldoc and idldoc_html_output on
 # saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
 # see dodocdownload
@@ -163,9 +167,9 @@
       do
 # does it contains pro or function ?
-      egrep -iq '^ *	*(pro|function)' $i
-      if [ $? -eq 0 ]
+      egrep -iq '^ *	*(pro|function)' ${i}
+      if [ ${?} -eq 0 ]
 	  then
-	  echo "print, '$( basename $i .pro ) :'" >> /tmp/compileall${$}.pro
- 	  echo "resolve_all, resolve_either = '$( basename $i .pro )', skip_routines = ['xxx2ps','trends', 'label_gmt']" >> /tmp/compileall${$}.pro
+	  echo "print, '$( basename ${i} .pro ) :'" >> /tmp/compileall${$}.pro
+ 	  echo "resolve_all, resolve_either = '$( basename ${i} .pro )', skip_routines = ['xxx2ps','trends', 'label_gmt']" >> /tmp/compileall${$}.pro
       fi
     done
@@ -233,6 +237,6 @@
     # build a idl file to launch idldoc
     output=../idldoc_html_output/
-    log="/tmp/idldochtlm_${$}.log"
-    pro="/tmp/idldochtlm_${$}.pro"
+    log="/tmp/idldochtml_${$}.log"
+    pro="/tmp/idldochtml_${$}.pro"
     cat <<EOF > ${pro}
 !path = expand_path('+' + '../idldoc/')
@@ -276,8 +280,8 @@
     #
     # count of directory levels in output
-    # this ount will be use to format relative path later
+    # 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" {} \;)
+    list_html_pro=$(find ${output} -name "*.html" -exec grep -l "<title>.*\.pro" {} \;)
     for file_html in ${list_html_pro}
     do
@@ -300,5 +304,5 @@
                    sed -e "s@${output}@${reloutput_html}@" \
                        -e "s@\$@/@")
-      echo "relpath ${relpath_html})"
+      # echo "relpath ${relpath_html})"
      else
       relpath_html="./"
@@ -337,4 +341,13 @@
      mv ${file_html}_modify ${file_html}
     done
+    # replace <pro>ginette</pro> by a sequence like
+    # <a href="./ginette.html">ginette</a>
+    ./pro2href.sh ${output}
+    status=${?}
+    if [ ${status} -ne 0 ]
+    then
+       echo "eee : pb during ./pro2href.sh"
+       exit 1
+    fi
     echo "iii : you can see log file in ${log}"
     echo "iii : and look ${output}/idldoc-warnings.html#undoc"
@@ -379,4 +392,7 @@
     #++ -e 's@\(href="#_.*\)\(_param_\)\(.*"\)@\1_keyword_\3@g' \ # ++ pb global
     #  ONLINE_HELP, book="../idldoc_assistant_output/idldoc-lib.adp", /full_path    # won't work
+    # encaspulate example content in <pre> </pre> in idldoc assistant outputs
+    # Examples section is supposed to start with <h3>Examples</h3>
+    # and end is before <h3>Version history</h3>
     list_html=$(find ${output} -name "*.html")
     for file_html in ${list_html}
@@ -393,7 +409,19 @@
      -e 's@^ <fixe>@<pre>@' \
      -e 's@^ </fixe>@</pre>@' \
+     -e "s@<h3>Examples</h3>@<h3>Examples</h3><pre>@" \
+     -e "s@<h3>Version history</h3>@</pre><h3>Version history</h3>@" \
      ${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 ${output}
+    status=0
+    status=${?}
+    if [ ${status} -ne 0 ]
+    then
+       echo "eee : pb during ./pro2href.sh"
+       exit 1
+    fi
     # add the directory-overview.html from dir-files.html in idldoc_html_output
     list_html=$(find ../idldoc_html_output -name dir-files.html)
@@ -418,10 +446,10 @@
     # check that the number of existing html files for each .pro file is 2!
     for i in $( find ../.. -name "*.pro" )
-      do
-      nhtml=$( find ../.. -name $( basename $i .pro ).html | wc -l )
-      if [ $nhtml -ne 2 ]
+    do
+      nhtml=$( find ../.. -name $( basename ${i} .pro ).html | wc -l )
+      if [ ${nhtml} -ne 2 ]
 	  then
-	  echo ERROR there is not 2 $( basename $i .pro ).html files 
-	  find ../.. -name $( basename $i .pro ).html
+	  echo ERROR there is not 2 $( basename ${i} .pro ).html files
+	  find ../.. -name $( basename ${i} .pro ).html
 	  echo
       fi
@@ -473,10 +501,10 @@
 fi
 #------------------------------------------------------------------
-if [[ ($doDTAlodyc -eq 1) || ($doDTAipsl -eq 1) ]]
+if [[ (${doDTAlodyc} -eq 1) || (${doDTAipsl} -eq 1) ]]
 then
     echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
     infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1)
     filedata=$(echo ${infodata} | awk '{print $NF}')
-    filedata=$(basename $filedata)
+    filedata=$(basename ${filedata})
     cat <<EOF > job_data_$$
 #!/bin/bash
@@ -484,8 +512,8 @@
 #
 rm -rf DATA
-wget http://forge.ipsl.jussieu.fr/saxo/download/$filedata
-gunzip $filedata
-tar vxf $( basename $filedata .gz )
-rm -f $( basename $filedata .gz )
+wget http://forge.ipsl.jussieu.fr/saxo/download/${filedata}
+gunzip ${filedata}
+tar vxf $( basename ${filedata} .gz )
+rm -f $( basename ${filedata} .gz )
 #
 chmod -R 755 *
@@ -495,5 +523,5 @@
 fi
 #------------------------------------------------------------------
-if [ $doSRClodyc -eq 1 ]
+if [ ${doSRClodyc} -eq 1 ]
 then
 # update src on cerbere
@@ -503,5 +531,5 @@
 fi
 #------------------------------------------------------------------
-if [ $doDTAlodyc -eq 1 ]
+if [ ${doDTAlodyc} -eq 1 ]
 then
 # update data on cerbere
@@ -511,5 +539,5 @@
 fi
 #------------------------------------------------------------------
-if [ $doSRCipsl -eq 1 ]
+if [ ${doSRCipsl} -eq 1 ]
 then
 # update src on calcul2
@@ -519,5 +547,5 @@
 fi
 #------------------------------------------------------------------
-if [ $doDTAipsl -eq 1 ]
+if [ ${doDTAipsl} -eq 1 ]
 then
 # update data on cook
@@ -527,5 +555,5 @@
 fi
 #------------------------------------------------------------------
-if [ $doSRCidris -eq 1 ]
+if [ ${doSRCidris} -eq 1 ]
 then
 # update src on rhodes
@@ -534,13 +562,13 @@
 fi
 #------------------------------------------------------------------
-if [ $doDTAidris -eq 1 ]
+if [ ${doDTAidris} -eq 1 ]
 then
 # create the update script for rhodes
-    if [[ ($doDTAlodyc -eq 0) && ($doDTAipsl -eq 0) ]]
+    if [[ (${doDTAlodyc} -eq 0) && (${doDTAipsl} -eq 0) ]]
 	then
 	echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
 	infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1)
 	filedata=$(echo ${infodata} | awk '{print $NF}')
-	filedata=$(basename $filedata)
+	filedata=$(basename ${filedata})
     fi
     cat <<EOF > job_data_idris_$$
@@ -550,8 +578,8 @@
 rm -rf DATA
 echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
-scp ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/$filedata .
-gunzip $filedata
-tar vxf $( basename $filedata .gz )
-rm -f $( basename $filedata .gz )
+scp ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/${filedata} .
+gunzip ${filedata}
+tar vxf $( basename ${filedata} .gz )
+rm -f $( basename ${filedata} .gz )
 #
 chmod -R 755 *
