work for the night.
This commit is contained in:
parent
cccadccba2
commit
c9f22bdc3d
2
Makefile
2
Makefile
@ -13,7 +13,7 @@ list-dir:
|
||||
@echo "=====DIRECTORIES======"
|
||||
find . -wholename './.hg' -prune , -type d -not -name .hg
|
||||
clean:
|
||||
rm -r out
|
||||
rm -rf out
|
||||
build:
|
||||
./render.sh
|
||||
push: build
|
||||
|
7
push.sh
7
push.sh
@ -1,7 +0,0 @@
|
||||
declare -a excl
|
||||
#while read i; do
|
||||
# excl+=($i)
|
||||
#done < tapeignore.txt
|
||||
#unset i
|
||||
cd ../..
|
||||
rclone sync neo:/ ./
|
33
render.sh
33
render.sh
@ -1,20 +1,21 @@
|
||||
#!/bin/bash
|
||||
# render.sh: part of the tape-and-string framework.
|
||||
# v2.1
|
||||
declare -A prog
|
||||
prog[m4]=`readlink -f main.html.m4`
|
||||
prog[lib]=`readlink -f lib.m4`
|
||||
prog[title]=`readlink -f titlelookup`
|
||||
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: $@"; }
|
||||
# v3.0
|
||||
. titles.sh
|
||||
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 {
|
||||
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 ;;
|
||||
*.txti) redcloth "$1" ;;
|
||||
*.org) org-ruby --translate html "$1" ;;
|
||||
*.md) comrak --gfm "$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
|
||||
}
|
||||
function yn {
|
||||
@ -29,10 +30,10 @@ function yn {
|
||||
esac
|
||||
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'`)
|
||||
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`)
|
||||
|
||||
inf "Creating directory structure..."
|
||||
@ -41,9 +42,9 @@ for i in ${dir[@]}; do
|
||||
mkdir -p out/$i
|
||||
done
|
||||
inf "Rendering document files..."
|
||||
for i in ${dir[@]}; do
|
||||
for i in ${doc[@]}; do
|
||||
echo $i
|
||||
tape $i | m4 -DTITLE=${title[$i]} main.html.m4
|
||||
tape $i | m4 -DTITLE="${title[$i]}" main.html.m4 > out/${i%.*}.html
|
||||
done
|
||||
inf "Rendering sass files..."
|
||||
if test -z "${sass[@]}"; then
|
||||
|
@ -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
4
titles.sh
Normal 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
2
titles.tsv
Normal file
@ -0,0 +1,2 @@
|
||||
index.txti Atlas48's Archives
|
||||
not_found.html 404 - Page Not Found
|
|
Loading…
x
Reference in New Issue
Block a user