~acdw/tssg

3468f66e48828ee1d82412fa77e32cf5448ccedb — Case Duckworth 5 years ago
First basic working model
1 files changed, 8 insertions(+), 0 deletions(-)

A tssg.sh
A  => tssg.sh +8 -0
@@ 1,8 @@
#!/bin/sh
I=./index.html;O="${1:-out}";H=hd.txt;F=ft.txt;mkdir -p $O;touch $H $F $I
alias eo='echo >>"$OF"' p=printf;po(){ cat $H "$1" >"$OF"; }
for f in ./*.html;do [ "$f" = $I ] || (OF="$O/$f";p "$f\t"
po "$f"; <$F >>"$OF";eo '<a id=ret href=.>return</a>';p OK\\n;) done
p "$I\t";OF="$O/$I";po "$I";eo '<ul id=toc>';for p in $O/*.html;do
[ -e "$p" ] && (t="$(sed -n 's,.*<title>\(.*\)</title>.*,\1,ip;T;q' "$p")"
eo "<li><a href='${p##*/}'>$t</a></li>";) done;eo "</ul>"; <$F >>"$OF";p OK\\n