Subversion Repositories wimsdev

Rev

Rev 6275 | Rev 7355 | 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)

!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
 !readproc namewriting.phtml \$slib_author
 !set slib_author=\$script_out
 !reset table_center
 \$table_header
 <caption>\$wims_name_slib</caption>
 \$table_tr<th>\$wims_name_name</th><td><span class="tt">\$slib_detail</span></td></tr>
 \$table_tr<th>\$wims_name_title</th><td>\$slib_title</td></tr>
 \$table_tr<th>\$wims_name_Author</th><td>\$slib_author</td></tr>
 \$table_tr<th>\$wims_name_call1</th><td><span class="tt">!readproc slib/\$slib_detail [parameters]</span> 
 <br />(\$wims_name_result slib_out) </td></tr>
 \$table_tr<th>\$wims_name_call2</th><td><span class="tt">slib(\$slib_detail [parameters])</span></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><span class="tt">\$slib_require</span></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
<p><span class="tt">\text{A=slib(\$slib_detail \$slib_exemple)}</span></p>
  !set slib_wims_backslash=\$wims_backslash_insmath
  !set wims_backslash_insmath=yes
  !readproc  slib/\$slib_detail \$slib_exemple
   <p>\$wims_name_Output:</p>
  !if table notin \$slib_out and object notin \$slib_out
   <pre>\$slib_out</pre>
  !else
   \$slib_out
  !endif
  !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'.

!reset table_center
\$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><span class="tt wims_code_words">$f</span></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