pagesize=${PAGESIZE:-100}
ordering=${ORDERING:-Om}
+style=$STYLE
djxl2ppm() {
djxl $1 $1.ppm
rm ${1}-ec1.pgm
}
+[[ -z $style ]] || style="<link rel=\"stylesheet\" type=\"text/css\" href=\"$style\">"
+
setopt EXTENDED_GLOB
imgs=((*.jxl|*.webp~*.preview.webp)($ordering))
for (( i=1 ; i <= ${#imgs} ; i++ )) {
local dst=$i.img.html
cat > $dst <<EOF
<!DOCTYPE html>
-<html><head><title>Image ${i}/${#imgs}: $img</title></head><body>
+<html><head>${style}<title>Image ${i}/${#imgs}: $img</title></head><body>
EOF
[[ $i -eq 1 ]] ||
echo "<a href=\"$(( $i - 1 )).img.html\"><<<</a>" >> $dst
local dst=$p.page.html
cat > $dst <<EOF
<!DOCTYPE html>
-<html><head><title>Page ${p}/$pages</title></head><body>
+<html><head>${style}<title>Page ${p}/$pages</title></head><body>
EOF
[[ $p -eq 1 ]] && [[ -r .txt ]] && {
echo "<pre>" >> $dst