summaryrefslogtreecommitdiff
path: root/mkall
blob: 59b5af6ecca2f12fb3c0cffd52c4b01c57800db4 (plain)
  1. #!/bin/sh
  2. # process text(s)
  3. set -e
  4. # resolve options
  5. eval set -- "$(getopt -s sh -o f -- "$@")"
  6. while true; do case "$1" in -f) force=-f; shift;; --) shift; break;; esac; done
  7. . /lib/lsb/init-functions
  8. # fetch PDF files
  9. ./mkpdf $force "$@"
  10. # resolve stems from available PDF files if none provided
  11. [ "$#" -gt 0 ] || eval set -- $(ls -1 *.pdf | sed 's/.pdf$//')
  12. # run tasks - either generic or with "_$stem" suffix
  13. log_action_begin_msg "Apply tasks"
  14. for stem in "$@"; do
  15. # log_action_cont_msg $stem
  16. # for task in pdf2txt txt2text slice; do
  17. # for task in pdf2htm htm2html html2md md2mdwn slice; do
  18. for task in pdf2htm htm2html; do
  19. # log_action_cont_msg $task
  20. # test ! -x $task-all || ./$task-all $force $stem
  21. taskscript=mk$task-$stem
  22. [ -x $taskscript ] || taskscript=mk$task-default
  23. ./$taskscript $force $stem
  24. done
  25. done
  26. log_action_end_msg $?