forked from kitodo/kitodo-presentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sphinx.sh
executable file
·55 lines (43 loc) · 1.07 KB
/
sphinx.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
#!/bin/bash
BASE_DIR=$(dirname "$0")
VENV_DIR="$BASE_DIR/venv"
DOCS_DIR="$BASE_DIR/../../Documentation"
function usage()
{
cat << EOF
Usage: sphinx.sh <command> [options]
Commands:
i, install Install Sphinx in a virtualenv
s, serve Serve documentation. Options are forwarded to sphinx-autobuild.
-H <host> Server host
-p <port> Server port
-a Write all files (from sphinx-build)
-E Don't use a saved environment (from sphinx-build)
EOF
exit
}
function use_sphinx()
{
source "$VENV_DIR/bin/activate"
}
COMMAND=$1
shift
case $COMMAND in
i|install)
if [ ! -e "$VENV_DIR" ]; then
# t3fieldlisttable doesn't seem to work with Python 3
virtualenv -p python2 "$VENV_DIR"
fi
use_sphinx
pip install sphinx-autobuild
pip install t3fieldlisttable
pip install sphinx_typo3_theme
;;
s|serve)
use_sphinx
sphinx-autobuild -c "$BASE_DIR" "$@" "$DOCS_DIR" "$BASE_DIR/_build"
;;
*)
usage
;;
esac