From: Paul Hänsch Date: Mon, 11 Feb 2019 22:38:27 +0000 (+0100) Subject: use shorthand html X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;ds=sidebyside;h=acc9d4587f930fdd7f7be5d3973b1e709f3ba029;p=clickslide use shorthand html --- diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2b34196 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "cgilite"] + path = cgilite + url = https://git.plutz.net/git/cgilite diff --git a/autoslide.sh b/autoslide.sh index a7d08bc..e2c40a8 100755 --- a/autoslide.sh +++ b/autoslide.sh @@ -3,47 +3,49 @@ last='' curr='' next='' idoff=1 -line="$(line)" -while :; do - tag="${tag}${line%%>*}" - - if [ "$line" = "${line%%>*}" ]; then - # $line did not contain ">" and thus was added to $tag entirely - if ! line="$(line)"; then - printf %s\\n "$tag" - break +"${0%/*}"/cgilite/html-sh.sed | { + line="$(line)" + while :; do + tag="${tag}${line%%>*}" + + if [ "$line" = "${line%%>*}" ]; then + # $line did not contain ">" and thus was added to $tag entirely + if ! line="$(line)"; then + printf %s\\n "$tag" + break + fi + tag="${tag} + " + else + # $line is shortened by segment added to $tag + line="${line#*>}" + tag="${tag}>" fi - tag="${tag} -" - else - # $line is shortened by segment added to $tag - line="${line#*>}" - tag="${tag}>" - fi - - case $tag in - *\*) - prev="$curr" curr="$next" - next="${tag#*previousnext*) - prev="$curr" curr="$next" - next="autoslide${idoff}" - idoff="$((idoff + 1))" - printf '%spreviousnext*) - printf %s "$tag" - tag='' - ;; - *) : - ;; - esac -done + + case $tag in + *\*) + prev="$curr" curr="$next" + next="${tag#*previousnext*) + prev="$curr" curr="$next" + next="autoslide${idoff}" + idoff="$((idoff + 1))" + printf '%spreviousnext*) + printf %s "$tag" + tag='' + ;; + *) : + ;; + esac + done +} diff --git a/cgilite b/cgilite new file mode 160000 index 0000000..441856d --- /dev/null +++ b/cgilite @@ -0,0 +1 @@ +Subproject commit 441856d88c45de3a8a12a8e3ac74f23f3d9b273b