5 # html2wxhelp Creates a wxhelp.map file from a directory full of html files.
6 # It takes header lines, extracts the NAME=xxx section for the URL and the help
7 # id which must be added to the header using _ID_.
9 # It also removes all _ID_ tags from the html sources.
14 cat $1 | tr -d '\n' | \
15 sed "1,$ s/^.*<[hH][0-9]\([^<].*\)<\/[hH][0-9]>.*$/
19 ' '\n' | egrep -v '^$
' | \
20 sed "1,$ s/^.*NAME=\"\([^\"]*\)\".*>\([^>]*\)<.*$/$1#\1;\2/g" | \
21 sed "1,$ s/^\#__\#[^>]*>\([^<>][^<>]*\)<.*$/;\1/g" | \
22 sed "1,$ s/^\(.*\);\(.*\)_\(.*\)_.*$/\3 \1 ;\2/g" | \
23 sed "1,$ s/^\([^+-0123456789]\)\(.*\);\(.*\)$/-1 \1\2 ;\3/g" | \
30 sed "1,$ s/_[0-9][0-9]*_//g" > tmp$$ && mv tmp$$ $1
31 # cat $1 | tr -d '\n' | \
32 # sed "1,$ s/^\(.*<[hH][0-9]\)\([^<_][^_]*\)_.*_*\(<\/[hH][0-9]>.*\)$/\1\2\3