X-Git-Url: http://git.chise.org/gitweb/?p=m17n%2Fm17n-docs.git;a=blobdiff_plain;f=utils%2Fdbdata.sh;h=f2095def09ad85a525cf9ccd394ef946c02154b4;hp=4dce3a089afa9122cf23fa7e07776c377d880a8b;hb=eec81e9290cc6e143f551aaf60d352a89a3c7f18;hpb=0a052fac8b4d98a220c661c96de98a5382e6c699;ds=sidebyside
diff --git a/utils/dbdata.sh b/utils/dbdata.sh
index 4dce3a0..f2095de 100755
--- a/utils/dbdata.sh
+++ b/utils/dbdata.sh
@@ -1,9 +1,54 @@
#!/bin/sh
+IMDOC=`pwd`/utils/imdoc
+
+set `ls $1/$2`
FILE=$1
while shift 1; do
- sed -n -e "/^(input-method/s/(input-method \([^ ]*\) \([^)]*\))/
$FILE \1 \2/p" $FILE
- echo
- sed -n -e '/^;;;/ s/^;;; *//p' -e '/^(description "/,/^")/ s/^(description "\|^")\|\\\|$//gp' $FILE
+ IM=`grep '^(input-method' $FILE`
+ if test -n "$IM"; then
+ if grep -q '^;;;' $FILE; then
+ sed -n -e '/^(input-method/s/(input-method \([^ ]*\) \([^ )]*\)\( \([^)]*\)\)*)/\1 \2 \4/p' $FILE | (read LNG NAME EXTRA
+ if test -z "NAME"; then
+ NAME=$EXTRA
+ fi
+ if test "$LNG" = "t"; then
+ LNG=generic
+ fi
+ if test "$NAME" = "nil"; then
+ HEADER=" $FILE (extra-name:$EXTRA, only for inclusion)"
+ HEADER2=""
+ else
+# 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"
+ fi
+ HEADER=" $base (language:$LNG name:$NAME @htmlonly"
+# if test -n "$title"; then
+# HEADER="$HEADER title:$title"
+# fi
+ HEADER2=""
+ HEADER3="@endhtmlonly"
+ HEADER4=")"
+ fi
+ echo "$HEADER"
+ if test -n "$HEADER2"; then
+ echo "$HEADER2"; echo "$HEADER3"; echo "$HEADER4"
+ fi
+ echo
+ sed -n -e '/^;;;/ p' $FILE | sed -e '/^[^;]/ s/$/
/' -e '/^;;;/ s/^;;; *//' | sed -e 's,^||,,' -e 's,||$, |
,' -e 's,|,,g'
+ )
+ else
+ M17NDIR=/usr/share/m17n $IMDOC $FILE "$IM"
+ fi
+ else
+ echo
+ sed -n -e '/^;;;/ p' $FILE | sed -e '/^[^;]/ s/$/ /' -e '/^;;;/ s/^;;; *//'
+ fi
FILE=$1
done
|