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=https://www.mupdf.com echo Processing $O "($TITLE)" sed '/<article>/,/<\/article>/p;d' < $I > temp.body cat >temp.head <<EOF <!DOCTYPE html> <html> <head> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-54391264-6"> </script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-54391264-6'); </script> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet"> <link rel="shortcut icon" type="image/png" href="$ROOT/images/favicon.png"> <link href="$ROOT/style.css" rel="stylesheet" type="text/css"> <title>$TITLE
EOF cat >temp.foot <
EOF cat temp.head temp.body temp.foot > $O done