summaryrefslogtreecommitdiff
path: root/mkall
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2013-05-10 20:46:04 +0200
committerJonas Smedegaard <dr@jones.dk>2013-05-10 20:46:04 +0200
commit27d338dec0428bc22e2838eb8641c6e0d1681e22 (patch)
tree18eeb76e189ce03838dd9b23194f1c707b1eabbb /mkall
Include mk* scripts
Diffstat (limited to 'mkall')
-rwxr-xr-xmkall33
1 files changed, 33 insertions, 0 deletions
diff --git a/mkall b/mkall
new file mode 100755
index 0000000..59b5af6
--- /dev/null
+++ b/mkall
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# process text(s)
+
+set -e
+
+# resolve options
+eval set -- "$(getopt -s sh -o f -- "$@")"
+while true; do case "$1" in -f) force=-f; shift;; --) shift; break;; esac; done
+
+. /lib/lsb/init-functions
+
+# fetch PDF files
+./mkpdf $force "$@"
+
+# resolve stems from available PDF files if none provided
+[ "$#" -gt 0 ] || eval set -- $(ls -1 *.pdf | sed 's/.pdf$//')
+
+# run tasks - either generic or with "_$stem" suffix
+log_action_begin_msg "Apply tasks"
+for stem in "$@"; do
+# log_action_cont_msg $stem
+# for task in pdf2txt txt2text slice; do
+# for task in pdf2htm htm2html html2md md2mdwn slice; do
+ for task in pdf2htm htm2html; do
+# log_action_cont_msg $task
+# test ! -x $task-all || ./$task-all $force $stem
+ taskscript=mk$task-$stem
+ [ -x $taskscript ] || taskscript=mk$task-default
+ ./$taskscript $force $stem
+ done
+done
+log_action_end_msg $?