*** empty log message ***
[m17n/m17n-docs.git] / utils / dbdata.sh
index 2978cf9..51d88f8 100755 (executable)
@@ -3,8 +3,8 @@
 IMDOC=`pwd`/utils/imdoc
 
 set `ls $1/$2`
-FILE=$1
-while shift 1; do
+while [ $# -ge 1 ] ; do
+    FILE=$1
     IM=`grep '^(input-method' $FILE`
     if test -n "$IM"; then
        if grep -q '^;;;' $FILE; then
@@ -19,20 +19,20 @@ while shift 1; do
                HEADER="<li> $FILE (extra-name:$EXTRA, only for inclusion)"
                HEADER2=""
            else
-               title=`sed -n -e '/^(title/s/(title \("[^"]*"\).*$/\1/p' $FILE`
+#              title=`sed -n -e '/^(title/s/(title \("[^"]*"\).*$/\1/p' $FILE`
                file=`basename $FILE`
                base=`basename $file .mim`
                dir=`dirname $FILE`
                dir=`dirname $dir`
                icon="$dir/icons/$base.png"
                if [ -f "$icon" ] ; then
-                   [ -f "images/icon-$base.png" ] || cp "$icon" "images/icon-$base.png"
+                   [ -f "images/icon-$base.png" ] || convert -resize 50% "$icon" "images/icon-$base.png"
                fi
                HEADER="<li> $base (language:$LNG name:$NAME @htmlonly"
-               if test -n "$title"; then
-                   HEADER="$HEADER title:$title"
-               fi
-               HEADER2="<img src=\"icon-$base.png\" style=\"vertical-align:middle;\">"
+#              if test -n "$title"; then
+#                  HEADER="$HEADER title:$title"
+#              fi
+               HEADER2="<img src=\"icon-$base.png\" border=\"1\" style=\"vertical-align:middle;\">"
                HEADER3="@endhtmlonly"
                HEADER4=")"
            fi
@@ -41,7 +41,15 @@ while shift 1; do
                echo "$HEADER2"; echo "$HEADER3"; echo "$HEADER4"
            fi
            echo
-            sed -n -e '/^;;;/ p' $FILE | sed -e '/^[^;]/ s/$/<br>/' -e '/^;;;/ s/^;;; *//' | sed -e 's,^||,<tr><td align="center">,' -e 's,||$,</td></tr>,' -e 's,|,</td><td align="center">,g')
+           echo "@htmlonly"
+           echo "<pre class=\"fragment\"><div class=\"fragment\">"
+           echo "@endhtmlonly"
+           sed -n -e '/^;;; *@/ s/;;; *\(.*\)/\1/p' \
+               -e '/^;;; *[^ @]/ s,;;; *\(.*\),\1@n,p' $FILE
+           echo "@htmlonly"
+           echo "</div></pre>"
+           echo "@endhtmlonly"
+           )
        else
            M17NDIR=/usr/share/m17n $IMDOC $FILE "$IM"
        fi
@@ -49,5 +57,5 @@ while shift 1; do
        echo
        sed -n -e '/^;;;/ p' $FILE | sed -e '/^[^;]/ s/$/<br>/' -e '/^;;;/ s/^;;; *//'
     fi
-    FILE=$1
+    shift
 done