#!/bin/sh
#
# this script generates a html-page with all icons on it
OUT=./iconlist1res.html
LIST=./iconlist.txt
BG0=#c0c0c0
BG1=#a0a0a0
BG=0
BGCOLOR=$BG0
addrow () {
attrname=attribute_$1
echo "
" >> "${OUT}"
echo " " >> "${OUT}"
echo " " >> "${OUT}"
echo " | " >> "${OUT}"
for f in 2 3; do
id=`grep "^\<$1\>" $LIST | cut -d "|" -f $f | sed "s/ *//g"`
[ -z "$id" ] && id=" "
echo "$id | " >> "${OUT}"
done
descyes=`grep "${attrname}_yes" ../../res/values/strings.xml | sed "s/^.*>\(.*\)<.*$/\1/"`
descno=`grep "${attrname}_no" ../../res/values/strings.xml | sed "s/^.*>\(.*\)<.*$/\1/"`
echo "$descyes $descno | ${attrname}_yes ${attrname}_no |
" >> "${OUT}"
BG=$(( $BG + 1 ))
[ $BG -eq 2 ] && BG=0
[ $BG -eq 0 ] && BGCOLOR=$BG0
[ $BG -eq 1 ] && BGCOLOR=$BG1
}
echo "" > "${OUT}"
echo "| icon | GC-ID | OC-ID | description | resource name |
" >> "${OUT}"
cat iconlist.txt | grep -v "^#" | while read i; do
name=`echo $i | cut -d "|" -f 1 | sed "s/ //g"`
addrow $name
done
echo "
" >> "${OUT}"
echo "generated file $OUT"