From ca1b2ce4289980e4e8d3d20fac5ef09ec6dd213b Mon Sep 17 00:00:00 2001 From: Christos Date: Wed, 1 Jan 2025 00:07:38 +0000 Subject: First commit --- cork-base.rc | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 cork-base.rc (limited to 'cork-base.rc') diff --git a/cork-base.rc b/cork-base.rc new file mode 100644 index 0000000..1beacf7 --- /dev/null +++ b/cork-base.rc @@ -0,0 +1,77 @@ +#!/bin/rc +path=(. /bin) +fn run { + lpaf=home$REQUEST_URI + rpafs='/'; wd='/'; ifs='/'; + arg = `{echo $REQUEST_URI} + if (test -d $lpaf) { + lpaf=$lpaf^'i' + } + for (i in $arg) { + wd=$wd^$i + rpafs=($rpafs $wd) + wd=$wd'/' + } + echo; + for (h in $bar) { $$h } + mh $lpaf.md +} +fn sbar { + echo -n 'ENTER HTML PREAMBLE HERE' + ls -F home/./$rpafs | sed -e 's,/+\./+,/,g' \ + -e '/\/i\.(md)$/d' \ + -e 's/\.(md)$//' -e 's!^home!!' | sort | awk -F/ ' + function p(x, y, s) { for (i=0; i"); p(lNF, NF, "
") + lNF = NF; fp = $NF + printf "
  • %s", $0, fp + } + END { p(lNF, 2, "
    "); printf "
    " }'} +fn add { + _l = $1^_^$#$1 + $_l = $*(2-) + $1 = ($$1 $_l) +} +add bar sbar; run + (avsbq) | cat cork-base +#!/bin/rc +path=(. /bin) +fn run { + lpaf=home$REQUEST_URI + rpafs='/'; wd='/'; ifs='/'; + arg = `{echo $REQUEST_URI} + if (test -d $lpaf) { + lpaf=$lpaf^'i' + } + for (i in $arg) { + wd=$wd^$i + rpafs=($rpafs $wd) + wd=$wd'/' + } + echo; + for (h in $bar) { $$h } + mh $lpaf.md +} +fn sbar { + echo -n '
    " }'} +fn add { + _l = $1^_^$#$1 + $_l = $*(2-) + $1 = ($$1 $_l) +} +add bar sbar; run -- cgit v1.2.3