#! /bin/sh
#
# module :
# ++ working on firststeps.xml before processing for HTML and wiki
#
# TODO
# ====
#
# file in/out parameters to be usable correctly in makefile
#
# update :
# $Id$
# fplod 2008-04-15T10:53:26Z aedon.locean-ipsl.upmc.fr (Darwin)
# creation from makehtml.sh
# adapation to docbook 5.0
#
set -u
set -o posix
#
# figures lists
cd ./figpng
#
figsplt_lev=""
for i in tst_plt_lev_[0-9][0-9].png
do
  figsplt_lev="${figsplt_lev} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltz_lev=""
for i in tst_pltz_lev_[0-9][0-9].png
do
  figspltz_lev="${figspltz_lev} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltt_lev=""
for i in tst_pltt_lev_[0-9][0-9].png
do
  figspltt_lev="${figspltt_lev} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
#
figsplt_orca2=""
for i in tst_plt_orca2_[0-9][0-9].png
do
  figsplt_orca2="${figsplt_orca2} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltz_orca2=""
for i in tst_pltz_orca2_[0-9][0-9].png
do
  figspltz_orca2="${figspltz_orca2} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltt_orca2=""
for i in tst_pltt_orca2_[0-9][0-9].png
do
  figspltt_orca2="${figspltt_orca2} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
#
figsplt_orca05=""
for i in tst_plt_orca05_[0-9][0-9].png
do
  figsplt_orca05="${figsplt_orca05} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltz_orca05=""
for i in tst_pltz_orca05_[0-9][0-9].png
do
  figspltz_orca05="${figspltz_orca05} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltt_orca05=""
for i in tst_pltt_orca05_[0-9][0-9].png
do
  figspltt_orca05="${figspltt_orca05} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
##
#
figsplt_lev_stride=""
for i in tst_plt_lev_stride_[0-9][0-9].png
do
  figsplt_lev_stride="${figsplt_lev_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltz_lev_stride=""
for i in tst_pltz_lev_stride_[0-9][0-9].png
do
  figspltz_lev_stride="${figspltz_lev_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltt_lev_stride=""
for i in tst_pltt_lev_stride_[0-9][0-9].png
do
  figspltt_lev_stride="${figspltt_lev_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
#
figsplt_orca2_stride=""
for i in tst_plt_orca2_stride_[0-9][0-9].png
do
  figsplt_orca2_stride="${figsplt_orca2_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltz_orca2_stride=""
for i in tst_pltz_orca2_stride_[0-9][0-9].png
do
  figspltz_orca2_stride="${figspltz_orca2_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltt_orca2_stride=""
for i in tst_pltt_orca2_stride_[0-9][0-9].png
do
  figspltt_orca2_stride="${figspltt_orca2_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
#
figsplt_orca05_stride=""
for i in tst_plt_orca05_stride_[0-9][0-9].png
do
  figsplt_orca05_stride="${figsplt_orca05_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltz_orca05_stride=""
for i in tst_pltz_orca05_stride_[0-9][0-9].png
do
  figspltz_orca05_stride="${figspltz_orca05_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
figspltt_orca05_stride=""
for i in tst_pltt_orca05_stride_[0-9][0-9].png
do
  figspltt_orca05_stride="${figspltt_orca05_stride} \<link xl:href=\"figpng\/${i}\"\>\&showfig\;\<\/link\>"
done
##
cd .. # ie <working space of saxo>/SRC/Documentation/xmldoc
#
rm firststeps_sed.xml 2> /dev/null
sed -e s/"\&figsplt_lev\;"/"${figsplt_lev}"/g \
-e s/"\&figsplt_orca2\;"/"${figsplt_orca2}"/g \
-e s/"\&figsplt_orca05\;"/"${figsplt_orca05}"/g \
-e s/"\&figspltz_lev\;"/"${figspltz_lev}"/g \
-e s/"\&figspltz_orca2\;"/"${figspltz_orca2}"/g \
-e s/"\&figspltz_orca05\;"/"${figspltz_orca05}"/g \
-e s/"\&figspltt_lev\;"/"${figspltt_lev}"/g \
-e s/"\&figspltt_orca2\;"/"${figspltt_orca2}"/g \
-e s/"\&figspltt_orca05\;"/"${figspltt_orca05}"/g \
-e s/"\&figsplt_lev_stride\;"/"${figsplt_lev_stride}"/g \
-e s/"\&figsplt_orca2_stride\;"/"${figsplt_orca2_stride}"/g \
-e s/"\&figsplt_orca05_stride\;"/"${figsplt_orca05_stride}"/g \
-e s/"\&figspltz_lev_stride\;"/"${figspltz_lev_stride}"/g \
-e s/"\&figspltz_orca2_stride\;"/"${figspltz_orca2_stride}"/g \
-e s/"\&figspltz_orca05_stride\;"/"${figspltz_orca05_stride}"/g \
-e s/"\&figspltt_lev_stride\;"/"${figspltt_lev_stride}"/g \
-e s/"\&figspltt_orca2_stride\;"/"${figspltt_orca2_stride}"/g \
-e s/"\&figspltt_orca05_stride\;"/"${figspltt_orca05_stride}"/g \
firststeps.xml > firststeps_sed.xml
#
# exit
exit 0
