3 SCRIPT=$(basename $BASH_SOURCE)
7 Usage: $SCRIPT [options] [pdf|serve|doxygen]
11 enable debug when generating pdf or html documentation
34 [[ $? != 0 ]] && usage
35 while [ $# -gt 0 ]; do
37 --debug) DEBUG_FLAG="--log=debug --debug";;
40 pdf | serve | doxygen) DO_ACTION=$1;;
49 # Create out dir if needed
50 [ -d $OUT_DIR ] || mkdir -p $OUT_DIR
52 if [ "$DO_ACTION" = "pdf" -o "$DO_ACTION" = "serve" ]; then
53 GITBOOK=`which gitbook`
54 [ "$?" = "1" ] && { echo "You must install gitbook first, using: sudo npm install -g gitbook-cli"; exit 1; }
56 EBCONV=`which ebook-convert`
57 [ "$?" = "1" ] && { echo "You must install calibre first, using: 'sudo apt install calibre' or refer to https://calibre-ebook.com/download"; exit 1; }
59 if [ "$DO_ACTION" = "pdf" ]; then
60 $DRY $GITBOOK pdf $ROOTDIR $OUT_DIR/LowLevelCanBinder_Guide.pdf $DEBUG_FLAG
62 $DRY $GITBOOK serve $DEBUG_FLAG
65 elif [ "$DO_ACTION" = "doxygen" ]; then
66 $DRY cd $OUT_DIR && cmake .. && make doxygen $ROOTDIR/Doxyfile
69 echo "Unknown action !"