From f6f49aa3157e6eb9a20a9b0f37f8041ae731e9f5 Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Fri, 17 Feb 2023 18:17:33 +0000 Subject: [PATCH] implemented link templating, finally. --- awk/getlinks.awk | 2 ++ get_sd.awk => awk/getsd.awk | 0 ignore.txt => dat/ignore.txt | 0 dat/links.csv | 1 + title.csv => dat/title.csv | 0 m4/main.html.m4 | 2 +- pfiles.rb | 4 ++-- render.sh | 12 ++++++------ 8 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 awk/getlinks.awk rename get_sd.awk => awk/getsd.awk (100%) rename ignore.txt => dat/ignore.txt (100%) create mode 100644 dat/links.csv rename title.csv => dat/title.csv (100%) diff --git a/awk/getlinks.awk b/awk/getlinks.awk new file mode 100644 index 0000000..41f8258 --- /dev/null +++ b/awk/getlinks.awk @@ -0,0 +1,2 @@ +BEGIN{FS=","} +{print "" $2 ""} diff --git a/get_sd.awk b/awk/getsd.awk similarity index 100% rename from get_sd.awk rename to awk/getsd.awk diff --git a/ignore.txt b/dat/ignore.txt similarity index 100% rename from ignore.txt rename to dat/ignore.txt diff --git a/dat/links.csv b/dat/links.csv new file mode 100644 index 0000000..3570084 --- /dev/null +++ b/dat/links.csv @@ -0,0 +1 @@ +/,Home diff --git a/title.csv b/dat/title.csv similarity index 100% rename from title.csv rename to dat/title.csv diff --git a/m4/main.html.m4 b/m4/main.html.m4 index 429fadf..e61a4cd 100644 --- a/m4/main.html.m4 +++ b/m4/main.html.m4 @@ -14,7 +14,7 @@ include(`m4/lib.m4')dnl
-Home +esyscmd(`awk -f awk/getlinks.awk dat/links.csv')dnl
esyscmd(`./tape.sh' _INFILE) diff --git a/pfiles.rb b/pfiles.rb index 9b62bbd..70c40b8 100755 --- a/pfiles.rb +++ b/pfiles.rb @@ -1,8 +1,8 @@ #!/usr/bin/ruby # pfiles.rb -# v1.0-p2 +# v1.0-p3 require 'find' -ignore=!File.file?('ignore.txt') ? [] : File.readlines('ignore.txt') +ignore=!File.file?('dat/ignore.txt') ? [] : File.readlines('dat/ignore.txt') if ignore != [] ignore.map! do |i| "in/#{i}" diff --git a/render.sh b/render.sh index 08570f9..a97166e 100755 --- a/render.sh +++ b/render.sh @@ -1,6 +1,6 @@ #!/bin/bash # render.sh: part of the tape-and-string framework. -# v3.4-p1 +# v3.4-p2 #B: Load enable -f /usr/lib/bash/csv csv declare -A title @@ -35,9 +35,9 @@ function docs { o="${i/in/out}" echo "$i => $o" if test -z "${title[$i]}"; then - m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") m4/main.html.m4 > ${o%.*}.html + m4 -D_INFILE="$i" -DCSSI=$(awk -f awk/getsd.awk <<< "$i") m4/main.html.m4 > ${o%.*}.html else - m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") -DTITLE="${title[$i]}" m4/main.html.m4 > ${o%.*}.html + m4 -D_INFILE="$i" -DCSSI=$(awk -f awk/getsd.awk <<< "$i") -DTITLE="${title[$i]}" m4/main.html.m4 > ${o%.*}.html fi done } @@ -57,7 +57,7 @@ function sass { o="${i/in/out}" o="${o/.s[ac]/.c}" echo "$i => $o" - sassc -t expanded -a $i | sed 'g/^$/d' > $o + sassc -t expanded -a $i | sed '/^$/d' > $o done fi } @@ -97,14 +97,14 @@ function info { while read -r ii; do csv -a i "$ii" title[in/${i[0]}]=${i[1]} -done < title.csv +done < dat/title.csv #E: Logic/LoadDefs/title unset ii #B: Logic/LoadDefs/ignore if test -f ignore.txt; then while read -r i; do ignore+=(in/$i) - done < ignore.txt + done < dat/ignore.txt fi #E: Logic/LoadDefs/ignore #E: Logic/LoadDefs