3 prev='' next='' idoff=0
6 { "${0%/*}"/cgilite/html-sh.sed || cat; } \
10 tag="${tag}${line%%>*}"
12 if [ "$line" = "${line%%>*}" ]; then
13 # $line did not contain ">" and thus was added to $tag entirely
14 if ! line="$(line)"; then
21 # $line is shortened by segment added to $tag
27 *\<head\>*|\*\<head\ *\>)
28 printf '%s<meta name="viewport" content="width=device-width">
29 <style type="text/css"><!--\n' "${tag%${tag#*<head*>}}"
30 cat "${0%/*}/clickslide.css"
31 printf '\n--></style>%s' "${tag#*<head*>}"
32 tag='' depth=$((depth + 1))
34 *\<slide\ *id=\"?*\"*\>*)
36 next="${tag#*<slide }" next="${next#*id=\"}" next="${next%\"*}"
37 next="autoslide${idoff}"
38 idoff="$((idoff + 1))"
39 printf '%s<a class="nextslide" href="#%s">next</a><div class="slide" count="%i" id="%s" %s' \
40 "${tag%<slide *}" "$next" "$idoff" "$next" "${tag#*<slide }"
41 tag='' depth=$((depth + 1))
43 *\<slide\ *\>*|*\<slide\>*)
45 next="autoslide${idoff}"
46 idoff="$((idoff + 1))"
47 printf '%s<a class="nextslide" href="#%s">next</a><div class="slide" count="%i" id="%s" %s' \
48 "${tag%<slide*}" "$next" "$idoff" "$next" "${tag#*<slide}"
49 tag='' depth=$((depth + 1))
52 printf '%s</div><a class="prevslide" href="#%s">previous</a>%s' \
53 "${tag%</slide>*}" "$prev" "${tag#*</slide>}"
54 tag='' depth=$((depth - 1))
56 *\<*class=\"uncover\"*\>*)
57 #printf '%s<li></li>' "$tag"
59 tag='' depth=$((depth + 1))
63 printf '%s<a href="#" class="toplevel">overview</a>' "$tag"
64 tag='' depth=$((depth + 1))
67 printf '<span class="count">%i</span>%s' "$idoff" "$tag"
68 tag='' depth=$((depth - 1))
72 tag='' depth=$((depth - 1))
73 [ $depth -lt $ucdepth ] && ucdepth=-1
76 if [ $ucdepth = $depth ]; then
77 printf '%s<input type="checkbox" class="uncover"/><%s' "${tag%<*}" "${tag#*<}"
81 [ "${tag}" = "${tag%/>}" ] && depth=$((depth + 1))