summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-06-17 10:18:20 -0700
committerKeith Packard <keithp@keithp.com>2016-06-17 10:18:20 -0700
commited6eb010614b5b27757619fc629d7330fc8c4122 (patch)
treef5f3071651513aa664e58bb4cf7ccdf6c0198fee
parentafe74c067a31ce420d0d4cdac2069c1d258a5114 (diff)
doc: Add install-html script
This script strips the XML-ish bits from html files so that ikiwiki can parse them correctly Signed-off-by: Keith Packard <keithp@keithp.com>
-rwxr-xr-xdoc/install-html32
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/install-html b/doc/install-html
new file mode 100755
index 00000000..71c7933c
--- /dev/null
+++ b/doc/install-html
@@ -0,0 +1,32 @@
+#!/bin/sh
+destination=
+state=arg
+for file in "$@"; do
+ case $state in
+ arg)
+ case $file in
+ -d)
+ state=destination
+ ;;
+ *)
+ base=`basename $file`
+ case "$destination" in
+ "")
+ echo "Need -d destination option before files" 1>&2
+ exit 1
+ ;;
+ *)
+ sed \
+ -e 's/<[?]xml [^>]*>//' \
+ -e 's/<!DOCTYPE [^>]*>//' "$file" > "$destination/$base"
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ destination)
+ destination=$file
+ state=arg
+ ;;
+ esac
+done