2022-03-21 03:12:23 +00:00
|
|
|
#!/bin/sh
|
|
|
|
d=$(mktemp -d)
|
2022-04-13 21:24:16 +00:00
|
|
|
bsdtar xf "$@" -C"$d"
|
|
|
|
t=$(fd -e ncx . "$d")
|
|
|
|
xml_grep content "$t" | uniq | grep content | cut -d\" -f2 |\
|
2022-03-21 03:12:23 +00:00
|
|
|
sed -e 's#.*#<a href="&">&</a><br />#' -e 's#">[^/<]*/#">#'\
|
2022-04-13 21:24:16 +00:00
|
|
|
-e 's/\.xhtml/\.html/g' > "$(dirname "$t")"/index.html
|
|
|
|
fd -e xhtml . "$d" -x mv {} '{.}'.html
|
|
|
|
if test -z "$BROWSER"; then
|
2022-03-21 03:12:23 +00:00
|
|
|
BROWSER=netsurf
|
|
|
|
fi
|
2023-10-17 01:28:11 +00:00
|
|
|
eval "$BROWSER" "$(dirname "$t")"/index.html
|
2022-04-13 21:24:16 +00:00
|
|
|
rm -rf "$d"
|