From 54530e1fe48b3b97e6883d428234bec1758817fc Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Sat, 11 Feb 2023 22:53:41 +0000 Subject: [PATCH 1/8] Slightly compacted sassc output --- render.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render.sh b/render.sh index dee48eb..2f2092b 100755 --- a/render.sh +++ b/render.sh @@ -71,7 +71,7 @@ function sass { o="${i/in/out}" o="${o/.s[ac]/.c}" echo "$i => $o" - sassc -t expanded -a $i $o + sassc -t expanded -a $i | sed 'g/^$/d' > $o done fi } From e1af43e29863992b01e4a358ac9ad05e2ba1bb5f Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Sun, 12 Feb 2023 18:06:40 +0000 Subject: [PATCH 2/8] Small file update. --- in/index.txti | 4 ++++ in/mgh/index.txti | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 in/mgh/index.txti diff --git a/in/index.txti b/in/index.txti index 44078ae..d19255c 100644 --- a/in/index.txti +++ b/in/index.txti @@ -12,3 +12,7 @@ h1. Links. h2. D&D +- "Antagonist Ideas":dnd/villains.html := Different Antagonist ideas to use in your games. + +h2. Elysium's Edge + diff --git a/in/mgh/index.txti b/in/mgh/index.txti new file mode 100644 index 0000000..b39a3fb --- /dev/null +++ b/in/mgh/index.txti @@ -0,0 +1,3 @@ +h1. Files + +- "Introduction":intro.html := A rough introduction to the setting. From 50dde3f39cebd4b1292e9c5eaa324f877933365b Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Sun, 12 Feb 2023 18:25:07 +0000 Subject: [PATCH 3/8] pagework --- in/img/ucbug.gif | Bin 0 -> 1133 bytes in/index.txti | 4 +++- in/mgh/index.txti | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 in/img/ucbug.gif diff --git a/in/img/ucbug.gif b/in/img/ucbug.gif new file mode 100644 index 0000000000000000000000000000000000000000..833d40cd3f755b26af6d31eaf32a0432d55a2c2e GIT binary patch literal 1133 zcmbu8{Y%|-6vvNXYD6>_i?(L4i?|+!LZ_H(tX4?QhaxBD%#?KcnFzbu5ABMO6LN7g zf^-TUC(}R-wL;xQ@dh=RZRMwJ2{{Wa*xVR8F71J-BRaj$_g~oOhkH4kbKd85-sj%j zyf?CURXsx)v`VD*ysD@=RaPa7yjL&koqASJmK3idDo%w}$ZDNeC+eI!R!7##URji# zGAk35l)RECIVDy?0BuM^3(cq|n`2MBciyx2WMdJDcyV6X3mFBHPP}v8v3F!psAci& zJhNv4BU(L)C+CShVJfI0253+M3posiHl(42X0nAW#&aSpLbe~qB63a~iz8bX6iBiY zW?{nifI_X16JjB(2S0#`ZrFkS0f7xc4KYB25~bk4U}!@cT4c^y8ZjO_M`k4U!&pSj zjtRbET~HwDh#kR4I1K~9g>o2;ZDA$+04BO&2bi!hHUu@q0F6#yfdhk~4Qa9ySvAs# z@dy`#k=PGo5i!}1!+Z_yZOPz-W^-^As|}1c*8}gYHL$~u5Nv2l0kqvD;4tAp8b1eI z3Fcv^IME_ejA)oBN)#a~A<7{N5v2m-0n+h!d~tCx7K;rJ4@aZXNF-8HQj(LC6AFb= zQ%!r@dSU{;Xor2+e$uB|#&vwmyf^)DZ*oo`#%xb$W(ZJ59N^YQBi9h(k4 z(Yo*U)uMKN=_ zc78mt-js25cK=Xk<~L0*Elh>a^&D9#zWu}A#G=QqP4}Ft?7LrG{nJ|c_`$ZRJIm>R zO5>r4+0>+lg|U_Jbj9kClizh_)tvwJR4o7dJ#(XP&B&+QvtDhE)crp9!GFcM&2=9w z?M=QIFO%Ju2LJthva;p=AFCZN>soGqOa9R0`-S&rR{I;fAI+``7e3px?URk|i5ps5 GY4`u#mJuxg literal 0 HcmV?d00001 diff --git a/in/index.txti b/in/index.txti index d19255c..6db7ca6 100644 --- a/in/index.txti +++ b/in/index.txti @@ -14,5 +14,7 @@ h2. D&D - "Antagonist Ideas":dnd/villains.html := Different Antagonist ideas to use in your games. -h2. Elysium's Edge +h2. Starfinder + +- "Elysium's Edge":mgh := Custom, homebrew Starfinder setting. diff --git a/in/mgh/index.txti b/in/mgh/index.txti index b39a3fb..97c2a3d 100644 --- a/in/mgh/index.txti +++ b/in/mgh/index.txti @@ -1,3 +1,4 @@ h1. Files - "Introduction":intro.html := A rough introduction to the setting. +- Homebrew Races !/img/ucbug.gif! := Various different races used in Elysium's Edge. From 4cf014f274fcd19b4e5a3dd3db69c5c735297fb4 Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Fri, 17 Feb 2023 13:13:52 +0000 Subject: [PATCH 4/8] Added shellscript support --- render.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/render.sh b/render.sh index 2f2092b..ba6b5fa 100755 --- a/render.sh +++ b/render.sh @@ -1,14 +1,14 @@ #!/bin/bash # render.sh: part of the tape-and-string framework. -# v3.3-p4 +# v3.4-p1 #B: Load enable -f /usr/lib/bash/csv csv declare -A title #E: Load #B: Definition -function inf { echo -e "\x1B[1;32mINF\x1B[0m: $*"; } -function wrn { echo -e "\x1B[1;93mWRN\x1B[0m: $*"; } -function err { echo -e "\x1B[1;31mERR\x1B[0m: $*"; } +function inf { 1>&2 echo -e "\x1B[1;32mINF\x1B[0m: $*"; } +function wrn { 1>&2 echo -e "\x1B[1;93mWRN\x1B[0m: $*"; } +function err { 1>&2 echo -e "\x1B[1;31mERR\x1B[0m: $*"; } function tape { if test -d "$1"; then err "tape: Passed directory, $1" @@ -20,6 +20,7 @@ function tape { *.md) comrak --gfm "$1" ;; *.html) cat $1 ;; *.s[ac]ss) err "Told to render $1, shouldn't happen"; return 1 ;; + *.sh) (inf "Running shellscript $1, I hope you know what you're doing..."; source $1 );; *) pandoc --columns 168 -t html "$1" || echo "Skipping $i, unknown format" ;; esac } @@ -127,15 +128,15 @@ if test -z "$*"; then exit $? fi case $1 in -dir) dirs;; -doc) docs;; -s[ac]ss) sass;; -other) other;; -rest) other;; -info) info;; -vall) info; all;; -all) all;; -*) all;; + dir) dirs;; + doc) docs;; + s[ac]ss) sass;; + other) other;; + rest) other;; + info) info;; + vall) info; all;; + all) all;; + *) all;; esac #E: Logic exit $? From 6735e712ebfd0d328f440f947c4bbc82cf714d0f Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Fri, 17 Feb 2023 14:32:32 +0000 Subject: [PATCH 5/8] refactored tape ssg --- m4/main.html.m4 | 6 ++++-- render.sh | 19 ++----------------- tape.sh | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 19 deletions(-) create mode 100755 tape.sh diff --git a/m4/main.html.m4 b/m4/main.html.m4 index 325a7ef..429fadf 100644 --- a/m4/main.html.m4 +++ b/m4/main.html.m4 @@ -1,6 +1,8 @@ -dnl template.m4.html v1.4-p1 +dnl template.m4.html v2.0-p1 dnl Part of the tape-and-string suite used to construct the website ifdef(`DEBUG',`traceon')dnl +ifdef(`_INFILE',`dnl ',`errprint(`Macro _INFILE is not defined') +m4exit(1)')dnl include(`m4/lib.m4')dnl @@ -15,7 +17,7 @@ include(`m4/lib.m4')dnl Home
-include(`/dev/stdin')dnl Probably not a good idea, but whatever. +esyscmd(`./tape.sh' _INFILE)
diff --git a/render.sh b/render.sh index ba6b5fa..08570f9 100755 --- a/render.sh +++ b/render.sh @@ -9,21 +9,6 @@ declare -A title function inf { 1>&2 echo -e "\x1B[1;32mINF\x1B[0m: $*"; } function wrn { 1>&2 echo -e "\x1B[1;93mWRN\x1B[0m: $*"; } function err { 1>&2 echo -e "\x1B[1;31mERR\x1B[0m: $*"; } -function tape { - if test -d "$1"; then - err "tape: Passed directory, $1" - return 1 - fi - case $1 in - *.txti) redcloth "$1" ;; - *.org) org-ruby --translate html "$1" ;; - *.md) comrak --gfm "$1" ;; - *.html) cat $1 ;; - *.s[ac]ss) err "Told to render $1, shouldn't happen"; return 1 ;; - *.sh) (inf "Running shellscript $1, I hope you know what you're doing..."; source $1 );; - *) pandoc --columns 168 -t html "$1" || echo "Skipping $i, unknown format" ;; - esac -} function dirs { if test -d out; then wrn "Directory 'out' already exists." @@ -50,9 +35,9 @@ function docs { o="${i/in/out}" echo "$i => $o" if test -z "${title[$i]}"; then - tape $i | m4 -DCSSI=$(awk -f get_sd.awk <<< "$i") m4/main.html.m4 > ${o%.*}.html + m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") m4/main.html.m4 > ${o%.*}.html else - tape $i | m4 -DCSSI=$(awk -f get_sd.awk <<< "$i") -DTITLE="${title[$i]}" m4/main.html.m4 > ${o%.*}.html + m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") -DTITLE="${title[$i]}" m4/main.html.m4 > ${o%.*}.html fi done } diff --git a/tape.sh b/tape.sh new file mode 100755 index 0000000..757596d --- /dev/null +++ b/tape.sh @@ -0,0 +1,22 @@ +#!/bin/bash +function inf { 1>&2 echo -e "\x1B[1;32mINF\x1B[0m: $*"; } +function wrn { 1>&2 echo -e "\x1B[1;93mWRN\x1B[0m: $*"; } +function err { 1>&2 echo -e "\x1B[1;31mERR\x1B[0m: $*"; } +if test -d "$1"; then + err "tape: Passed directory, $1" + return 1 +elif test -z "$*"; then + err "No files passed." + exit 1 +fi +case $1 in + _INFILE) err "Passed raw macro."; exit 1;; + *.txti) redcloth "$1" ;; + *.org) org-ruby --translate html "$1" ;; + *.md) comrak --gfm "$1" ;; + *.html) cat $1 ;; + *.s[ac]ss) err "Told to render $1, shouldn't happen"; exit 1 ;; + *.sh) (inf "Running shellscript $1, I hope you know what you're doing..."; source $1 );; + *) pandoc --columns 168 -t html "$1" || echo "Skipping $i, unknown format" ;; +esac + From 9087f05a34b5c3fecbfbea405c0484d2ca5cf467 Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Fri, 17 Feb 2023 16:15:53 +0000 Subject: [PATCH 6/8] Refactor work --- Makefile | 2 ++ m4/lib.m4 | 11 +++++------ m4/linkdata.m4 | 2 ++ m4/main.html.m4 | 11 +++++++---- render.sh | 6 +++--- 5 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 m4/linkdata.m4 diff --git a/Makefile b/Makefile index a38b41b..2411429 100644 --- a/Makefile +++ b/Makefile @@ -16,5 +16,7 @@ clean: rm -rf out build: ./render.sh +sitemap: out/sitemap.xml + ./gensimap.sh push: build rclone sync -v out/ neo:/ diff --git a/m4/lib.m4 b/m4/lib.m4 index 46841d6..a89e069 100644 --- a/m4/lib.m4 +++ b/m4/lib.m4 @@ -1,6 +1,5 @@ -divert(-1) -# extra macros for site structure -define(`_ytv',`') -define(`_wrap',<$1>$2) -define(`_empty',`') -divert dnl +dnl extra macros for site structure +define(`_wrap',<$1>$2)dnl +define(`_a',$2)dnl +define(`_empty',`')dnl +define(`_ytv',`')dnl diff --git a/m4/linkdata.m4 b/m4/linkdata.m4 new file mode 100644 index 0000000..7f56e1b --- /dev/null +++ b/m4/linkdata.m4 @@ -0,0 +1,2 @@ +define(`entr', `pushdef(`_LINK',$1)')dnl +entr(`/,Home') diff --git a/m4/main.html.m4 b/m4/main.html.m4 index 429fadf..ea83fdc 100644 --- a/m4/main.html.m4 +++ b/m4/main.html.m4 @@ -1,9 +1,11 @@ dnl template.m4.html v2.0-p1 dnl Part of the tape-and-string suite used to construct the website ifdef(`DEBUG',`traceon')dnl -ifdef(`_INFILE',`dnl ',`errprint(`Macro _INFILE is not defined') -m4exit(1)')dnl -include(`m4/lib.m4')dnl +# ifdef(`_INFILE',`dnl ',`errprint(`Macro _INFILE is not defined') +# m4exit(1)')dnl +include(`lib.m4')dnl +include(`linkdata.m4')dnl +define(`_la',`_a(`argn(`1',$1),argn(`2',$1)') @@ -14,10 +16,11 @@ include(`m4/lib.m4')dnl
+stack_foreach(`_LINK',`_la') Home
-esyscmd(`./tape.sh' _INFILE) +# esyscmd(`./tape.sh' _INFILE)dnl
diff --git a/render.sh b/render.sh index 08570f9..3bcbdad 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 -I m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.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 -I m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") -DTITLE="${title[$i]}" m4/main.html.m4 > ${o%.*}.html fi done } From 22fac1e5023b08b76c722b048eb02b210f7cfc5b Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Fri, 17 Feb 2023 17:54:30 +0000 Subject: [PATCH 7/8] Revert "Refactor work" This reverts commit 9087f05a34b5c3fecbfbea405c0484d2ca5cf467. --- Makefile | 2 -- m4/lib.m4 | 11 ++++++----- m4/linkdata.m4 | 2 -- m4/main.html.m4 | 11 ++++------- render.sh | 6 +++--- 5 files changed, 13 insertions(+), 19 deletions(-) delete mode 100644 m4/linkdata.m4 diff --git a/Makefile b/Makefile index 2411429..a38b41b 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,5 @@ clean: rm -rf out build: ./render.sh -sitemap: out/sitemap.xml - ./gensimap.sh push: build rclone sync -v out/ neo:/ diff --git a/m4/lib.m4 b/m4/lib.m4 index a89e069..46841d6 100644 --- a/m4/lib.m4 +++ b/m4/lib.m4 @@ -1,5 +1,6 @@ -dnl extra macros for site structure -define(`_wrap',<$1>$2)dnl -define(`_a',$2)dnl -define(`_empty',`')dnl -define(`_ytv',`')dnl +divert(-1) +# extra macros for site structure +define(`_ytv',`') +define(`_wrap',<$1>$2) +define(`_empty',`') +divert dnl diff --git a/m4/linkdata.m4 b/m4/linkdata.m4 deleted file mode 100644 index 7f56e1b..0000000 --- a/m4/linkdata.m4 +++ /dev/null @@ -1,2 +0,0 @@ -define(`entr', `pushdef(`_LINK',$1)')dnl -entr(`/,Home') diff --git a/m4/main.html.m4 b/m4/main.html.m4 index ea83fdc..429fadf 100644 --- a/m4/main.html.m4 +++ b/m4/main.html.m4 @@ -1,11 +1,9 @@ dnl template.m4.html v2.0-p1 dnl Part of the tape-and-string suite used to construct the website ifdef(`DEBUG',`traceon')dnl -# ifdef(`_INFILE',`dnl ',`errprint(`Macro _INFILE is not defined') -# m4exit(1)')dnl -include(`lib.m4')dnl -include(`linkdata.m4')dnl -define(`_la',`_a(`argn(`1',$1),argn(`2',$1)') +ifdef(`_INFILE',`dnl ',`errprint(`Macro _INFILE is not defined') +m4exit(1)')dnl +include(`m4/lib.m4')dnl @@ -16,11 +14,10 @@ define(`_la',`_a(`argn(`1',$1),argn(`2',$1)')
-stack_foreach(`_LINK',`_la') Home
-# esyscmd(`./tape.sh' _INFILE)dnl +esyscmd(`./tape.sh' _INFILE)
diff --git a/render.sh b/render.sh index 3bcbdad..08570f9 100755 --- a/render.sh +++ b/render.sh @@ -1,6 +1,6 @@ #!/bin/bash # render.sh: part of the tape-and-string framework. -# v3.4-p2 +# v3.4-p1 #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 -I m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") m4/main.html.m4 > ${o%.*}.html + m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") m4/main.html.m4 > ${o%.*}.html else - m4 -I 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 get_sd.awk <<< "$i") -DTITLE="${title[$i]}" m4/main.html.m4 > ${o%.*}.html fi done } From f6f49aa3157e6eb9a20a9b0f37f8041ae731e9f5 Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Fri, 17 Feb 2023 18:17:33 +0000 Subject: [PATCH 8/8] 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