summaryrefslogtreecommitdiffstats
path: root/conf.d/app-templates/gendocs.sh
diff options
context:
space:
mode:
authorTai Vuong <tvuong@audiokinetic.com>2017-11-02 16:31:15 -0400
committerTai Vuong <tvuong@audiokinetic.com>2017-11-02 16:31:15 -0400
commit5d2ee4455d95771d12cc6058bc19c0d6f7fe43d1 (patch)
treeb4cbc2be7475641edf71ae42c6ce117dba27b91d /conf.d/app-templates/gendocs.sh
parente92aade201ec131c3eb7430305f60a0a4c9c44c1 (diff)
parentab6e470190f2cc410b1f6fa8f146317a3c3b08b5 (diff)
merge dev branch with master
Diffstat (limited to 'conf.d/app-templates/gendocs.sh')
-rwxr-xr-xconf.d/app-templates/gendocs.sh79
1 files changed, 0 insertions, 79 deletions
diff --git a/conf.d/app-templates/gendocs.sh b/conf.d/app-templates/gendocs.sh
deleted file mode 100755
index ea9400a..0000000
--- a/conf.d/app-templates/gendocs.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-
-OUTFILENAME="Gitbook-Iotbzh-template"
-
-SCRIPT=$(basename $BASH_SOURCE)
-
-function usage() {
- cat <<EOF >&2
-Usage: $SCRIPT [options] [pdf|serve|doxygen]
-
-Options:
- --debug
- enable debug when generating pdf or html documentation
- -d|--dry
- dry run
- -h|--help
- get this help
-
-Example:
- $SCRIPT pdf
-
-EOF
- exit 1
-}
-
-function info() {
- echo "$@" >&2
-}
-
-#default values
-DEBUG_FLAG=""
-DRY=""
-DO_ACTION=""
-OUT_DIR=./build
-
-[[ $? != 0 ]] && usage
-while [ $# -gt 0 ]; do
- case "$1" in
- --debug) DEBUG_FLAG="--log=debug --debug";;
- -d|--dry) DRY=echo;;
- -h|--help) usage;;
- pdf | serve | doxygen) DO_ACTION=$1;;
- --) break;;
- esac
- shift
-done
-
-cd $(dirname $0)
-ROOTDIR=`pwd -P`
-
-# Create out dir if needed
-[ -d $OUT_DIR ] || mkdir -p $OUT_DIR
-
-if [ "$DO_ACTION" = "pdf" -o "$DO_ACTION" = "serve" ]; then
- GITBOOK=`which gitbook`
- [ "$?" = "1" ] && { echo "You must install gitbook first, using: sudo npm install -g gitbook-cli"; exit 1; }
-
- EBCONV=`which ebook-convert`
- [ "$?" = "1" ] && { echo "You must install calibre first, using: 'sudo apt install calibre' or refer to https://calibre-ebook.com/download"; exit 1; }
-
- if [ "$DO_ACTION" = "pdf" ]; then
-
- # Update cover when book.json has been changed
- [[ $ROOTDIR/book.json -nt $ROOTDIR/docs/cover.jpg ]] && { echo "Update cover files"; $ROOTDIR/docs/resources/make_cover.sh || exit 1; }
-
- OUTFILE=$OUT_DIR/$OUTFILENAME.pdf
- $DRY $GITBOOK pdf $ROOTDIR $OUTFILE $DEBUG_FLAG
- [ "$?" = "0" ] && echo "PDF has been successfully generated in $OUTFILE"
- else
- $DRY $GITBOOK serve $DEBUG_FLAG
- fi
-
-elif [ "$DO_ACTION" = "doxygen" ]; then
- $DRY cd $OUT_DIR && cmake .. && make doxygen $ROOTDIR/Doxyfile
-
-else
- echo "Unknown action !"
- usage
-fi