Advertisement
pouar

builddoc.sh

Mar 19th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | None | 0 0
  1. #!/bin/sh
  2. build()
  3. {
  4.     case $1 in
  5.         manpage|tex|text|htmlhelp|ps|pdf|dvi|epub)
  6.             a2x --format $1 --dblatex-opts="-b dvips" -L $2
  7.             ;;
  8.         html5)
  9.             asciidoc -o ${2%adoc}html -b $1 $2
  10.             ;;
  11.         docbook)
  12.             asciidoc -o ${2%adoc}xml -b $1 $2
  13.             ;;
  14.         chm)
  15.             buildchm.sh ${2%adoc}hhp
  16.             ;;
  17.         *)
  18.             echo "format hasn't been set up yet"
  19.             exit 1
  20.             ;;
  21.     esac
  22. }
  23. if [ "$2" ];then
  24.     build "$1" "$2"
  25. else
  26.     for i in *.adoc;do
  27.         build "$1" "$i"
  28.     done
  29. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement