view bin/pub @ 0:2aa53823fb21

new repo
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Sat, 06 Jun 2026 10:19:04 +0100
parents
children
line wrap: on
line source

#!/bin/sh
if [ '-?' = "$1" ]
then
 shift
fi
if [ '-a' = "$1" ]
then
 shift
 ENC=!encoding=US-ASCII
else
 ENC=
fi
if [ '-f' = "$1" ]
then
 shift
 if [ '-l' = "$1" ]
 then
  shift
  LL="$1"
  shift
 else
  LL=.
  if [ ! -r "srr2.png" ]
   then
    cp -a /home/ht/Documents/HTalks/Icons/{srr2,24px-Cc-*}.png .
  fi
 fi
 SS="file:///d:/lib/xml/doc.xsl license=$LL/"
 AA=
else
 SS=
 AA=-a
fi
if [ '-d' = "$1" ]
then
 shift
 DIR="$1"
 shift
fi
if [ '' = "$1" ]
then
    echo "Usage: pub [-a] [-f [-l license-icon-dir]] [-p dir] fileroot [destroot]"
else
    dest=${2:-$1}.html
    saxon92 $AA $1.xml $SS $ENC > $dest
    Echo "now psav msg fileroot"
fi
if [ "$DIR" ]
then
 echo -n uploading to public_html/$DIR . . .
 lxprintf -e '*[@href|@src]' '%s\n' '@href|@src' $dest | egrep '^./|^[^/]*$' | \
   xargs tar -czf - $dest | goE "/home/ht/share/bin/install-stdin $DIR"
 echo 
uploading to public_html/$DIR . . . done
fi