3 OUTFILENAME="Application-Framework-Service"
5 SCRIPT=$(basename $BASH_SOURCE)
9 Usage: $SCRIPT [options] [pdf|serve|doxygen]
13 enable debug when generating pdf or html documentation
36 [[ $? != 0 ]] && usage
37 while [ $# -gt 0 ]; do
39 --debug) DEBUG_FLAG="--log=debug --debug";;
42 pdf | serve | doxygen) DO_ACTION=$1;;
51 # Create out dir if needed
52 [ -d $OUT_DIR ] || mkdir -p $OUT_DIR
54 if [ "$DO_ACTION" = "pdf" -o "$DO_ACTION" = "serve" ]; then
55 GITBOOK=`which gitbook`
56 [ "$?" = "1" ] && { echo "You must install gitbook first, using: sudo npm install -g gitbook-cli"; exit 1; }
58 EBCONV=`which ebook-convert`
59 [ "$?" = "1" ] && { echo "You must install calibre first, using: 'sudo apt install calibre' or refer to https://calibre-ebook.com/download"; exit 1; }
61 if [ "$DO_ACTION" = "pdf" ]; then
62 OUTFILE=$OUT_DIR/$OUTFILENAME.pdf
63 $DRY $GITBOOK pdf $ROOTDIR $OUTFILE $DEBUG_FLAG
64 [ "$?" = "0" ] && echo "PDF has been successfully generated in $OUTFILE"
66 $DRY $GITBOOK serve $DEBUG_FLAG
69 elif [ "$DO_ACTION" = "doxygen" ]; then
70 $DRY cd $OUT_DIR && cmake .. && make doxygen $ROOTDIR/Doxyfile
73 echo "Unknown action !"