: Filter for converting a MATHS document into HTML if [ $# -eq 0 ]; then echo Usage: $0 input_files; exit 1; fi # extract contents list and index tmp=/tmp/mth2html$$; index=$tmp.index; contents=$tmp.contents trap "rm $tmp*" 1 2 3 sed -n '/^[ ]*\([A-Za-z0-9_]*\)[ ]*::=[ ]*Net.*$/s//
  • \1<\/A>/p s/^\.Open *\(.*\)$/
  • \1<\/A>/p s/^\. \(.*\)$/
  • \1<\/A>/p' $@ >$contents sed -n '/^[ ]*\([A-Za-z0-9_]*\)[ ]*::=[ ]*.*$/s//
  • \1<\/A>/p s/^\.Open *\(.*\)$/
  • \1<\/A>/p s/^\. \(.*\)$/
  • \1<\/A>/p' $@|sort >$index # cat $@|br 78|awk 'BEGIN{n=1; } /^\.Open/{ $1=$1 n;n++; if(n>6)n=6;} /^\. ./{ $1=$1 n; } /^\.Close/{n--; if(n<1)n=1; } {print}'| ( echo "$1

    " $@ "

    " [ -r standard.include.html ] && cat standard.include.html echo "

    Contents

    " echo "
    " sed '/^\.Close/d s/\&/\&/g s/\/\>/g s/\"/\"/g s/^$/

    / s/^\.See \(.*\):\(\/\/.*\)\/\([^/]*\)\.\([^.]*\)$/ \3<\/A>/ s/^\.See \(.*\):\(\/.*\)$/ \2<\/A>/ s/^\.See \(.*\)$/ \1<\/A>/ s/^\.Open\(.\) *\(.*\)$/\2<\/H\1><\/A>/ s/^\.Source *\(.*\)$/\1,<\/cite>/ s/^\.\(.\) \(.*\)$/\2<\/H\1><\/A>/ s/^\.\(.*\)$/
    \1<\/H6>/ /^[ ]*\([A-Za-z0-9_]*\)[ ]*::=[ ]*\(.*\)$/s//
    \1<\/A>::=
    \2/ s/^[ ][ ]*/
    / ' echo "
    " echo "

    Sections and Definitions in Alphabetical Order

    " echo "" echo "" ) rm $tmp*