blob: c8e4037c3a179da40722ae189db3247b3267e84f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#!/bin/sh
# hwrap -- wrap in <html> tag
d=
l=
t=5
while getopts d:l:t: o; do
case $o in
d) d=$OPTARG ;;
l) l=$OPTARG ;;
t) t=$OPTARG ;;
?) echo usage: $0 [-d DIR] [-l LANG] [-t DOCTYPE] 1>&2; exit 1 ;;
esac
done
shift $((OPTIND-1))
case "$t" in
5) echo '<!DOCTYPE html>' ;;
4) echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">' ;;
4t) echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">' ;;
4f) echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">' ;;
x1) echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' ;;
x1t) echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' ;;
x1f) echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">' ;;
x11) echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' ;;
xb11) echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">' ;;
esac
printf '<html'
test ! -z "$d" && printf ' dir="%s"' "$d"
test ! -z "$l" && printf ' lang="%s"' "$l"
echo '>'
cat
echo '</html>'
|