summaryrefslogtreecommitdiff
path: root/fix-website.sh
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2010-02-23 21:55:09 +0100
committerPeter Simons <simons@cryp.to>2010-02-23 22:19:27 +0100
commitd2a28302a8492de0a100e4ea57c6b40d5c3daa06 (patch)
tree88047f88af9cae1732171b9d20d86bc796ec735a /fix-website.sh
parent12d8aa36440d2937878258c0be7801631eba46df (diff)
downloadautoconf-archive-d2a28302a8492de0a100e4ea57c6b40d5c3daa06.tar.gz
fix-website.sh: run generated HTML through tidy to ensure it's clean
Diffstat (limited to 'fix-website.sh')
-rwxr-xr-xfix-website.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/fix-website.sh b/fix-website.sh
index 8d552e6..8de202e 100755
--- a/fix-website.sh
+++ b/fix-website.sh
@@ -11,7 +11,12 @@ mkdir -p "$destdir"
for n in *.html; do
echo fixing "$n"
- sed <"$n" >"$destdir/${n//_005f/_}" \
+ out="${n//_005f/_}"
+ name="${out%%.html}"
+ sed <"$n" \
+ -e 's|<html lang="en">|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"><html lang="en">|' \
+ -e "s|<a name=\"${name}\"></a>||" \
-e 's|_005f|_|g' \
- -e 's|href="../index.html#dir">(dir)</a>|href="http://savannah.nongnu.org/projects/autoconf-archive/">Home Page at Savannah</a>|g'
+ -e 's|href="../index.html#dir">(dir)</a>|href="http://savannah.nongnu.org/projects/autoconf-archive/">Home Page at Savannah</a>|g' \
+ | tidy >"$destdir/${out}" -q --indent yes --indent-spaces 1 -wrap 80 --tidy-mark no --hide-comments yes
done