work on tape and string

This commit is contained in:
Atlas Cove 2023-02-01 16:04:04 +00:00
parent 5827f9cf95
commit 7eb4c3104d
2 changed files with 16 additions and 2 deletions

View File

@ -5,9 +5,12 @@ cd ..
files=(`find -not -path '_*'`)
for i in ${files[@]}; do
if test -d $i; then
if test -d ../$i; then
mkdir -p ../$i
else continue
fi
elif test -f $i; then
tape $i | m4 -DTITLE=`${prog[title]} $i` .
tape $i | m4 -DTITLE=`${prog[title]}` ${prog[m4]} < $i ../$i
else
echo "Skipping $i, unknown file type"
fi

11
src/_tape/string.sh Normal file
View File

@ -0,0 +1,11 @@
declare -A prog
prog[m4]=`readlink -f main.html`
prog[title]=`readlink -f titlelookup`
function tape {
case $1 in
*.txti) redcloth $1 ;;
*.org) org-ruby --translate html $1 ;;
*.md) comrak --gfm $1 ;;
*) pandoc --cols 168 -t html $i || echo "Unable to render $i, unknown format" ;;
esac
}