#!/bin/zsh list_comments() { base="$1" for each in $(ls -r Wiki/${base}.comment.<0000000001-9999999999>_<000-999>); do author=$(grep -m1 '^author=' "$each" |cut -d= -f2-) echo "

$author wrote:

" tail -n+2 $each |_wiki echo '
' done } add_comment(){ info="$1" cat <Comment / Ask WikiEND } cat <


Revisions: $(rno=1; for each in Wiki/$info.<0000000000-9999999999>; do revi=$(cut -d. -f2 <<<"$each") echo "$rno" rno=$(($rno+1)) done) Latest

$($LOGIN && if [ -z "$lock" ]; then [ -z "$rev" ] && echo "edit this page" [ -n "$rev" ] && echo "Click edit to derive a new page revision from this one." else echo "This page is currently being edited by $lockedit anyway" fi $LOGIN && echo '
')

Table of Content

$(cat Wiki/"${info}${rev}" |while read line; do if (egrep -q '^ *###' <<<"$line"); then echo "$(sed 's,^ *###,,' <<<"$line")
" elif (egrep -q '^ *##' <<<"$line"); then echo "$(sed 's,^ *##,,' <<<"$line")
" elif (egrep -q '^ *#' <<<"$line"); then echo "$(sed 's,^ *#,,' <<<"$line")
" fi done)

$title

$(_wiki Wiki/"${info}${rev}")
WikiEND