From 7eb4c3104d80672ddd760588bd8584d88dbaed48 Mon Sep 17 00:00:00 2001 From: Atlas Cove <5618106+Atlas48@users.noreply.github.com> Date: Wed, 1 Feb 2023 16:04:04 +0000 Subject: [PATCH] work on tape and string --- src/_tape/render.sh | 7 +++++-- src/_tape/string.sh | 11 +++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/_tape/string.sh diff --git a/src/_tape/render.sh b/src/_tape/render.sh index 4e7f9a4..6e47e82 100755 --- a/src/_tape/render.sh +++ b/src/_tape/render.sh @@ -5,9 +5,12 @@ cd .. files=(`find -not -path '_*'`) for i in ${files[@]}; do if test -d $i; then - mkdir -p ../$i + 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 diff --git a/src/_tape/string.sh b/src/_tape/string.sh new file mode 100644 index 0000000..55a1b60 --- /dev/null +++ b/src/_tape/string.sh @@ -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 +}