Subversion Repositories wimsdev

Rev

Rev 4169 | Rev 5584 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#! /bin/sh

cd `dirname $0`
cd ..
WIMS_HOME=`pwd`
cd $WIMS_HOME/slib

cat <<@ >index.phtml
!! This file is automatically generated! Do not edit it.
!! Edit the script 'mkindex'.

!if adm/createxo isin \$module
  !set slib_cmd=help
!endif
!read tabletheme
!read lang/slib.phtml.\$lang
!if \$slib_lang_exists!=yes
  !read lang/slib.phtml.en
!endif
!default slib_cmd=resume
!default slib_detname=special_cmd
!set slib_detail=\$(\$slib_detname)
<p>
!if \$slib_detail!=\$empty
 !readproc slib/\$slib_detail slib_header
 !reset slib_lang_exists_tmp
 !readproc help/\$lang/slib/\$slib_detail
 !if \$slib_lang_exists_tmp!=yes
  !readproc help/en/slib/\$slib_detail
 !endif
 !distribute lines \$slib_parms into slpcnt,slp1,slp2,slp3,slp4,slp5,slp6,slp7,slp8,slp9,slp10,slp11,slp12
 !for i=1 to \$slpcnt
  !set slpdflt\$i=!item 1 of \$(slp\$i)
  !set slp\$i=!item 2 to -1 of \$(slp\$i)
 !next i

 \$table_header
 <caption>\$wims_name_slib</caption>
 \$table_tr<th>\$wims_name_name</th><td><tt>\$slib_detail</tt></td></tr>
 \$table_tr<th>\$wims_name_title</th><td>\$slib_title</td></tr>
 \$table_tr<th>\$wims_name_call1</th><td><tt>!readproc slib/\$slib_detail [parameters]</tt></td></tr>
 \$table_tr<th>\$wims_name_call2</th><td><tt>slib(\$slib_detail [parameters])</tt></td></tr>
 \$table_tr<th>\$wims_name_Parameters</th><td>
 !if \$slpcnt>1
  !if + isin \$slpcnt
   \$wims_name_variable_list
  !else
   \$wims_name_upto
  !endif
 !else
  \$slpcnt
 !endif
 </td></tr>
 !for i=1 to \$slpcnt
  \$table_tr<th>\$wims_name_Parameter \$i
  !ifval \$i=\$slpcnt and + isin \$slpcnt
   and up
  !endif
  </th>
  <td>\$(slp\$i)
  !if \$(slpdflt\$i)!=\$empty
   <em>(\$wims_name_default: \$(slpdflt\$i))</em>
  !endif
  </td></tr>
 !next i
 \$table_tr<th>\$wims_name_Output</th><td>\$slib_out</td></tr>
 !if \$slib_comment!=\$empty
  \$table_tr<th>\$wims_name_comment</th><td>\$slib_comment</td></tr>
 !endif
 !if \$slib_require!=\$empty
    \$table_tr<th>\$wims_name_Required_Software</th><td><tt>\$slib_require</tt></td></tr>
 !endif
 !if \$slib_example!=\$empty
!set excnt=!linecnt \$slib_example
  \$table_tr<th>\$wims_name_Example OEF </th><td>
  !for i=1 to \$excnt
 !set  slib_exemple=!line \$i of \$slib_example
<tt><b>\text{A=slib(\$slib_detail \$slib_exemple)}</b></tt>
  !set slib_wims_backslash=\$wims_backslash_insmath
  !set wims_backslash_insmath=yes
  !readproc  slib/\$slib_detail \$slib_exemple
   <p>\$wims_name_Output:
   <pre>\$slib_out</pre>
  !set wims_backslash_insmath=\$slib_wims_backslash
  !reset slib_wims_backslash
  !next i
  !reset slib_exemple
  </td></tr>
 !endif

 \$table_end
 !reset \$slib_detname
 !exit
!endif
\$wims_name_instruction

!read slib/index.phtml.\$lang
@
for ll in fr en nl it cn es de ar ca si
do
echo  "!! This file is automatically generated! Do not edit it.
!! Edit the script 'mkindex'.

<p>
\$table_header
<caption>\$wims_name_listslib</caption>
\$table_tr<th>\$wims_name_name</th><th>\$wims_name_Output</th></tr>
" > index.phtml.$ll
cnt=0
for f in `find . -type f | sed 's!^\./!!g' | grep ./ |  egrep -v '\/\.svn\/' |  egrep -v '\.html'| sort`
do
 if [ -f "$WIMS_HOME/help/$ll/slib/$f" ]; then
  tit=`awk -F= '$1=="slib_title" {print $2; exit}' $WIMS_HOME/help/$ll/slib/$f`
 fi
 if [ -z "$tit" ]; then
  if [ -f "$WIMS_HOME/help/en/slib/$f" ]; then
   tit=`awk -F= '$1=="slib_title" {print $2; exit}' $WIMS_HOME/help/en/slib/$f`
  else
   tit=`awk -F= '$1=="slib_title" {print $2; exit}' $f`
  fi
 fi
 if [ -n "$tit" ]; then
  echo $f
  cnt=`expr $cnt + 1`
  cat <<@ >>index.phtml.$ll
\$table_tr<td><tt>$f</tt></td><td>$tit
!href cmd=\$slib_cmd&special_parm=slib&\$slib_detname=$f\$slib_detailanchor [\$wims_name_detail]
</td></tr>
@
 tit=''
 fi
done
cat <<@ >>index.phtml.$ll
\$table_end
@
echo $ll done
done
echo
echo Indexed $cnt scripts.
echo