]> git.plutz.net Git - clickslide/commitdiff
use shorthand html
authorPaul Hänsch <paul@plutz.net>
Mon, 11 Feb 2019 22:38:27 +0000 (23:38 +0100)
committerPaul Hänsch <paul@plutz.net>
Mon, 11 Feb 2019 22:38:27 +0000 (23:38 +0100)
.gitmodules [new file with mode: 0644]
autoslide.sh
cgilite [new submodule]

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..2b34196
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "cgilite"]
+       path = cgilite
+       url = https://git.plutz.net/git/cgilite
index a7d08bcd86e3d72433e49a35e0a42a467272c56c..e2c40a86f47a8841f5dd53710f95f0b2786556d5 100755 (executable)
@@ -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
-    *\<slide\ *id=\"?*\"*\>*)
-      prev="$curr" curr="$next"
-      next="${tag#*<slide }"
-      next="${next#*id=\"}"
-      next="${next%\"*}"
-      printf '%s<a href="#%s">previous</a><a href="#%s">next</a><slide %s' \
-        "${tag%<slide *}" "$prev" "$next" "${tag#*<slide }"
-      tag=''
-      ;;
-    *\<slide\ *\>*)
-      prev="$curr" curr="$next"
-      next="autoslide${idoff}"
-      idoff="$((idoff + 1))"
-      printf '%s<a href="#%s">previous</a><a href="#%s">next</a><slide %s' \
-        "${tag%<slide *}" "$prev" "$next" "${tag#*<slide }"
-      tag=''
-      ;;
-    *\<*\>*)
-      printf %s "$tag"
-      tag=''
-      ;;
-    *) :
-      ;;
-  esac
-done
+  
+    case $tag in
+      *\<slide\ *id=\"?*\"*\>*)
+        prev="$curr" curr="$next"
+        next="${tag#*<slide }"
+        next="${next#*id=\"}"
+        next="${next%\"*}"
+        printf '%s<a href="#%s">previous</a><a href="#%s">next</a><slide %s' \
+          "${tag%<slide *}" "$prev" "$next" "${tag#*<slide }"
+        tag=''
+        ;;
+      *\<slide\ *\>*)
+        prev="$curr" curr="$next"
+        next="autoslide${idoff}"
+        idoff="$((idoff + 1))"
+        printf '%s<a href="#%s">previous</a><a href="#%s">next</a><slide %s' \
+          "${tag%<slide *}" "$prev" "$next" "${tag#*<slide }"
+        tag=''
+        ;;
+      *\<*\>*)
+        printf %s "$tag"
+        tag=''
+        ;;
+      *) :
+        ;;
+    esac
+  done
+}
diff --git a/cgilite b/cgilite
new file mode 160000 (submodule)
index 0000000..441856d
--- /dev/null
+++ b/cgilite
@@ -0,0 +1 @@
+Subproject commit 441856d88c45de3a8a12a8e3ac74f23f3d9b273b