summaryrefslogtreecommitdiffstats
path: root/gendocs.sh
blob: ea9400ab53b708fdd6f2dddfbf8a205fc24cce1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Ou
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