#!/bin/sh processline() { echo "- $1 -" echo "==============================================================================================" name="$1" anchors="" echo "$1.txt $*" >> anchors while [ "$1" != "" ] ; do echo "s!\[help:$1\]!$name.html!g" >> htmllinks.sed echo "s!\[help:$1\]!help:anchor=$name bookID=XaoS Help!g" >> applehelplinks.sed shift done # I changed "0" to "$" because my sed # doesn't want to understand "0". # -- Zoltan echo ' XaoS online help ' > $name.html cat $mypath/xaos.hlp | sed '1,/%'"$name"'/d;/^%/,$ d' | sed \ '1,2s_\([^<]*\)_

\1

_g s__

_g s__

_g s___g s___g s___g s___g s___g s___g s___g s_
__g s_
__g s___g s___g s___g s___g s___g s_
__g s___g s___g s_]*\)>__g s___g s_]*\)>__g s/'\'\''/"/g s/``/"/g' >> $name.html if [ $2 ]; then echo $* >> aliases.conf fi echo "" >> $name.html cat -n $name.html tidy -utf8 -asxml -qm $name.html $mypath/xhtml2rest.py $name.html > $name.txt rm $name.html } process() { while read line ; do eval "processline $line" done } mypath=`dirname $0` rm htmllinks.sed rm applehelplinks.sed rm anchors grep "^%" $mypath/xaos.hlp | sed '/%%/d;s/%//g' | process