This repository has been archived by the owner on Nov 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
make.sh
executable file
·85 lines (75 loc) · 2.89 KB
/
make.sh
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
# @ECHO OFF
function usage() {
echo " Please use 'make ^<target^>' where ^<target^> is one of"
echo " html to make standalone HTML files"
echo " dirhtml to make HTML files named index.html in directories"
echo " singlehtml to make a single large HTML file"
echo " pickle to make pickle files"
echo " json to make JSON files"
echo " htmlhelp to make HTML files and a HTML help project"
echo " qthelp to make HTML files and a qthelp project"
echo " devhelp to make HTML files and a Devhelp project"
echo " epub to make an epub"
echo " latex to make LaTeX files, you can export PAPER=a4 or PAPER=letter"
echo " text to make text files"
echo " man to make manual pages"
echo " texinfo to make Texinfo files"
echo " gettext to make PO message catalogs"
echo " changes to make an overview over all changed/added/deprecated items"
echo " linkcheck to check all external links for integrity"
echo " doctest to run all doctests embedded in the documentation if enabled"
echo " clean remove previously generated files"
}
case "$1" in
clean|gettext|htmlhelp|qthelp|html|dirhtml|singlehtml|pickle|json|epub|latex|text|man|texinfo|changes|linkcheck|doctest)
#do nothing
;;
*)
usage
exit 0
;;
esac
# Command file for Sphinx documentation
if [ -z "$SPHINXBUILD" ]; then
export SPHINXBUILD='sphinx-build'
fi
#export BUILDDIR=${DOCUMENTATION_BUILDDIR-'_build'}
if [ -z "$DOCUMENTATION_BUILDDIR" ]; then
export BUILDDIR=_build
else
export BUILDDIR="$DOCUMENTATION_BUILDDIR"
fi
export ALLSPHINXOPTS="-d $BUILDDIR/doctrees $SPHINXOPTS ."
export I18NSPHINXOPTS="$SPHINXOPTS"
if [ -n "$PAPER" ]; then
export ALLSPHINXOPTS="-D latex_paper_size=$PAPER $ALLSPHINXOPTS ."
export I18NSPHINXOPTS="-D latex_paper_size=$PAPER $I18NSPHINXOPTS ."
fi
if [ "$1" = "clean" ]; then
rm -rf $BUILDDIR
res=$?
elif [ "$1" = "gettext" ]; then
$SPHINXBUILD -b gettext $I18NSPHINXOPTS $BUILDDIR /locale
res=$?
echo "Build finished. The message catalogs are in $BUILDDIR /locale."
elif [ "$1" = "htmlhelp" ]; then
$SPHINXBUILD -b htmlhelp $ALLSPHINXOPTS $BUILDDIR /htmlhelp
res=$?
echo "Build finished; now you can run HTML Help Workshop with the \n.hhp project file in $BUILDDIR /htmlhelp."
elif [ "$1" = "qthelp" ]; then
$SPHINXBUILD -b qthelp $ALLSPHINXOPTS $BUILDDIR /qthelp
res=$?
echo "Build finished; now you can run 'qcollectiongenerator' with the \n.qhcp project file in $BUILDDIR /qthelp, like this:"
echo "\n > qcollectiongenerator $BUILDDIR\qthelp\TheOroPlatform.qhcp"
echo "\n To view the help file:"
echo "\n ^> assistant -collectionFile $BUILDDIR\qthelp\TheOroPlatform.ghc"
else
mkdir $BUILDDIR
exec_cmd="$SPHINXBUILD -b $1 $ALLSPHINXOPTS $BUILDDIR/$1 -w $BUILDDIR/sphinxbuild.log"
$exec_cmd
res=$?
echo "executed: $exec_cmd"
echo "result: $res"
fi
exit $res