work for the night.

This commit is contained in:
Atlas Cove 2023-02-07 04:00:03 +00:00
parent cccadccba2
commit c9f22bdc3d
6 changed files with 24 additions and 33 deletions

View File

@ -13,7 +13,7 @@ list-dir:
@echo "=====DIRECTORIES======" @echo "=====DIRECTORIES======"
find . -wholename './.hg' -prune , -type d -not -name .hg find . -wholename './.hg' -prune , -type d -not -name .hg
clean: clean:
rm -r out rm -rf out
build: build:
./render.sh ./render.sh
push: build push: build

View File

@ -1,7 +0,0 @@
declare -a excl
#while read i; do
# excl+=($i)
#done < tapeignore.txt
#unset i
cd ../..
rclone sync neo:/ ./

View File

@ -1,20 +1,21 @@
#!/bin/bash #!/bin/bash
# render.sh: part of the tape-and-string framework. # render.sh: part of the tape-and-string framework.
# v2.1 # v3.0
declare -A prog . titles.sh
prog[m4]=`readlink -f main.html.m4` function inf { echo -e "\x1B[1;32mINF\x1B[0m: $*"; }
prog[lib]=`readlink -f lib.m4` function wrn { echo -e "\x1B[1;93mWRN\x1B[0m: $*"; }
prog[title]=`readlink -f titlelookup` function err { echo -e "\x1B[1;31mERR\x1B[0m: $*"; }
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 tape { function tape {
if test -d "$1"; then
err "tape: Passed directory, $1"
return 1
fi
case $1 in case $1 in
*.txti) redcloth $1 ;; *.txti) redcloth "$1" ;;
*.org) org-ruby --translate html $1 ;; *.org) org-ruby --translate html "$1" ;;
*.md) comrak --gfm $1 ;; *.md) comrak --gfm "$1" ;;
*.html) cat $1 ;; *.html) cat $1 ;;
*) pandoc --columns 168 -t html $i || echo "Skipping $i, unknown format" ;; *) pandoc --columns 168 -t html "$1" || echo "Skipping $i, unknown format" ;;
esac esac
} }
function yn { function yn {
@ -29,10 +30,10 @@ function yn {
esac esac
done done
} }
doc=(`find . -wholename './.hg' -prune , -type f -name '*.txti' , -name '*.org' , -name '*.md'`) doc=(`find . -wholename './.hg' -prune , -type f -name '*.txti' -o -name '*.org' -o -name '*.md'`)
sass=(`find . -wholename './.hg' -prune , -type f -name '*.sass'`) sass=(`find . -wholename './.hg' -prune , -type f -name '*.sass'`)
scss=(`find . -wholename './.hg' -prune , -type f -name '*.scss'`) scss=(`find . -wholename './.hg' -prune , -type f -name '*.scss'`)
rest=(`find . -wholename './.hg' -prune , -type f ! \( -name '*.org' , -name '*.txti' , -name '*.md' , -name .hg \)`) rest=(`find . -wholename './.hg' -prune , -type f ! \( -name '*.org' -o -name '*.txti' -o -name '*.md' -o -name .hg \)`)
dir=(`find . -wholename './.hg' -prune , -type d -not -name .hg`) dir=(`find . -wholename './.hg' -prune , -type d -not -name .hg`)
inf "Creating directory structure..." inf "Creating directory structure..."
@ -41,9 +42,9 @@ for i in ${dir[@]}; do
mkdir -p out/$i mkdir -p out/$i
done done
inf "Rendering document files..." inf "Rendering document files..."
for i in ${dir[@]}; do for i in ${doc[@]}; do
echo $i echo $i
tape $i | m4 -DTITLE=${title[$i]} main.html.m4 tape $i | m4 -DTITLE="${title[$i]}" main.html.m4 > out/${i%.*}.html
done done
inf "Rendering sass files..." inf "Rendering sass files..."
if test -z "${sass[@]}"; then if test -z "${sass[@]}"; then

View File

@ -1,9 +0,0 @@
use std::env::args;
fn main() {
let l:String = args().next().unwrap();
match l.as_str() {
"not_found.txti" => println!("404 - Page Not Found"),
"index.txti" => println!("Atlas48's Archives"),
_ => println!("Atlas48's Archives"),
}
}

4
titles.sh Normal file
View File

@ -0,0 +1,4 @@
declare -A titles
titles["not_found.txti"]="404 - Page Not Found"
titles["index.txti"]="Atlas48's Archives"

2
titles.tsv Normal file
View File

@ -0,0 +1,2 @@
index.txti Atlas48's Archives
not_found.html 404 - Page Not Found
1 index.txti Atlas48's Archives
2 not_found.html 404 - Page Not Found