INPUT=docs OUTPUT=../web/mupdf.com/docs for I in $(find $INPUT/examples -type f) do B=$(echo $I | sed s,$INPUT/,,) O=$OUTPUT/$B cp $I $O done for I in $(find $INPUT -name '*.html') do B=$(echo $I | sed s,$INPUT/,,) O=$OUTPUT/$B TITLE=$(cat $I | grep '' | sed 's,</*title>,,g') ROOT=$(realpath --relative-to=$(dirname $I) $PWD) echo Processing $O "($TITLE)" sed '/<article>/,/<\/article>/p;d' < $I > temp.body cat >temp.head <<EOF <!DOCTYPE html> <html lang="en"> <head> <title>$TITLE
EOF cat >temp.foot <
EOF cat temp.head temp.body temp.foot > $O done