Compare commits
4 Commits
bdbcfbbecd
...
c92d67b96c
Author | SHA1 | Date | |
---|---|---|---|
c92d67b96c | |||
3a82aaefde | |||
8f117a417a | |||
33ef377cc3 |
39
render.sh
39
render.sh
|
@ -1,27 +1,28 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# render.sh: part of the tape-and-string framework.
|
# render.sh: part of the tape-and-string framework.
|
||||||
#V:3.6-p1
|
#V:3.7r0
|
||||||
#B: Load
|
#B: Load
|
||||||
enable -f /usr/lib/bash/csv csv
|
enable -f /usr/lib/bash/csv csv
|
||||||
declare -A title
|
declare -A title
|
||||||
#E: Load
|
#E: Load
|
||||||
#B: Definition
|
#B: Definition
|
||||||
|
#B: Definition/Ampelstatus
|
||||||
function inf { 1>&2 echo -e "\x1B[1;32mINF\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 wrn { 1>&2 echo -e "\x1B[1;93mWRN\x1B[0m: $*"; }
|
||||||
function err { 1>&2 echo -e "\x1B[1;31mERR\x1B[0m: $*"; }
|
function err { 1>&2 echo -e "\x1B[1;31mERR\x1B[0m: $*"; }
|
||||||
|
#E: Defintion/Ampelstatus
|
||||||
function dirs {
|
function dirs {
|
||||||
if test -d out; then
|
if test -d out; then
|
||||||
wrn "Directory 'out' already exists."
|
wrn "Directory 'out' already exists."
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
local i o dir
|
local i o dir odir
|
||||||
dir=(`./pfiles.rb dir`)
|
dir=(`./pfiles.rb dir`)
|
||||||
inf "Creating directory structure..."
|
inf "\x1B[1m[dirs]\x1B[0m Creating directory structure..."
|
||||||
echo ${dir[@]}
|
echo ${dir[@]}
|
||||||
for i in ${dir[@]}; do
|
for i in ${dir[@]}; do
|
||||||
o="${i/in/out}"
|
odir+="${i/in/out} "
|
||||||
mkdir -pv $o
|
|
||||||
done
|
done
|
||||||
|
mkdir -pv $odir
|
||||||
}
|
}
|
||||||
function docs {
|
function docs {
|
||||||
load_title
|
load_title
|
||||||
|
@ -31,7 +32,7 @@ function docs {
|
||||||
fi
|
fi
|
||||||
local i o doc
|
local i o doc
|
||||||
doc=(`./pfiles.rb doc`)
|
doc=(`./pfiles.rb doc`)
|
||||||
inf "Rendering document files..."
|
inf "\x1B[1m[docs]\x1B[0m Rendering document files..."
|
||||||
for i in ${doc[@]}; do
|
for i in ${doc[@]}; do
|
||||||
o="${i/in/out}"
|
o="${i/in/out}"
|
||||||
o="${o%.*}.html"
|
o="${o%.*}.html"
|
||||||
|
@ -48,27 +49,26 @@ function sassfn {
|
||||||
err "Cannot render, directory 'out' does not exist, run ./render.sh dir"
|
err "Cannot render, directory 'out' does not exist, run ./render.sh dir"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
inf "Rendering sass files..."
|
inf "\x1B[1m[sassfn]\x1B[0m Rendering sass files..."
|
||||||
sass --no-source-map in/css:out/css
|
sass --no-source-map in/css:out/css
|
||||||
}
|
}
|
||||||
function other {
|
function other {
|
||||||
local other=`./pfiles.rb rest`
|
inf "\x1B[1m[other]\x1B[0m Hardlinking other files..."
|
||||||
|
local i other=`./pfiles.rb rest`
|
||||||
for i in $other; do
|
for i in $other; do
|
||||||
if test -f $i; then
|
local o=${i/in/out}
|
||||||
|
if test -f $o; then
|
||||||
inf "Skipping $i, file/hardlink exists..."
|
inf "Skipping $i, file/hardlink exists..."
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
ln -v $i ${i/in/out}
|
ln -v $i $o
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
function sitemap {
|
|
||||||
./gensimap.sh
|
|
||||||
}
|
|
||||||
function all {
|
function all {
|
||||||
load_title
|
load_title
|
||||||
dirs
|
dirs
|
||||||
docs
|
docs
|
||||||
sass
|
sassfn
|
||||||
other
|
other
|
||||||
}
|
}
|
||||||
function info {
|
function info {
|
||||||
|
@ -111,16 +111,21 @@ if test -z "$*"; then
|
||||||
fi
|
fi
|
||||||
case $1 in
|
case $1 in
|
||||||
dir) dirs;;
|
dir) dirs;;
|
||||||
|
dirs) dirs;;
|
||||||
doc) docs;;
|
doc) docs;;
|
||||||
docs) docs;;
|
docs) docs;;
|
||||||
s[ac]ss) sassfn;;
|
s[ac]ss) sassfn;;
|
||||||
other) dirs; other;;
|
other) dirs; other;;
|
||||||
rest) other;;
|
rest) other;;
|
||||||
info) info;;
|
info) info;;
|
||||||
sitemap) sitemap;;
|
sitemap) ./sitemap.sh;;
|
||||||
vall) info; all;;
|
vall) info; all;;
|
||||||
all) all;;
|
all) all;;
|
||||||
*) all;;
|
clean) inf "Removing out..."; rm -rf out;;
|
||||||
|
*)
|
||||||
|
err "Unknown value, $1."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
#E: Logic
|
#E: Logic
|
||||||
exit $?
|
exit $?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user