X-Git-Url: http://git.plutz.net/?p=clickslide;a=blobdiff_plain;f=clickslide.sh;fp=autoslide.sh;h=ddc94c37ef79e44753e54fc71b670f1aef45d0f2;hp=ead295b3dcf14a524345c2923369962cc041674a;hb=c2772fd3bec6c84a3bfdcd90b2008d9381c10876;hpb=33051920f2a111c3f6474843968a8e1ef80e68ab diff --git a/autoslide.sh b/clickslide.sh similarity index 61% rename from autoslide.sh rename to clickslide.sh index ead295b..ddc94c3 100755 --- a/autoslide.sh +++ b/clickslide.sh @@ -1,8 +1,10 @@ #!/bin/sh prev='' next='' idoff=0 +depth=0 ucdepth=-1 -"${0%/*}"/cgilite/html-sh.sed | { +{ "${0%/*}"/cgilite/html-sh.sed || cat; } \ +| { line="$(line)" while :; do tag="${tag}${line%%>*}" @@ -22,6 +24,13 @@ prev='' next='' idoff=0 fi case $tag in + *\*|\*\) + printf '%s + %s' "${tag#*}" + tag='' depth=$((depth + 1)) + ;; *\*) prev="$next" next="${tag#*next
*|*\*) prev="$next" @@ -37,27 +46,39 @@ prev='' next='' idoff=0 idoff="$((idoff + 1))" printf '%snext
*) printf '%s
previous%s' \ "${tag%*}" "$prev" "${tag#*}" - tag='' + tag='' depth=$((depth - 1)) ;; *\<*class=\"uncover\"*\>*) - printf '%s' "$tag" - tag='' + #printf '%s
  • ' "$tag" + printf '%s' "$tag" + tag='' depth=$((depth + 1)) + ucdepth=$depth ;; *\*) printf '%soverview' "$tag" - tag='' + tag='' depth=$((depth + 1)) ;; *\*) printf '%i%s' "$idoff" "$tag" - tag='' + tag='' depth=$((depth - 1)) ;; - *\<*\>*) + *\*) printf %s "$tag" + tag='' depth=$((depth - 1)) + [ $depth -lt $ucdepth ] && ucdepth=-1 + ;; + *\<*\>*) + if [ $ucdepth = $depth ]; then + printf '%s<%s' "${tag%<*}" "${tag#*<}" + else + printf %s "$tag" + fi + [ "${tag}" = "${tag%/>}" ] && depth=$((depth + 1)) tag='' ;; *) :