-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.sh
executable file
·36 lines (29 loc) · 919 Bytes
/
build.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
#!/bin/bash
#
# Preprocesses docs and runs Sphinx (apidoc and build) to build the HTML docs.
#
# Requires:
# brew install pandoc
# pip install sphinx (in virtualenv)
set -e
absfile=`readlink -f $0`
cd `dirname $absfile`
# generates the module index files:
# docs/source/oauth_dropins.rst, oauth_dropins.webutil.rst
# only used to bootstrap. we've edited by hand since then so don't run any more
# or it will overwrite them.
# sphinx-apidoc -f -o source ../oauth_dropins \
# ../oauth_dropins/{webutil,}/{appengine_config.py,tests}
rm -f index.rst
cat > index.rst <<EOF
oauth-dropins
-------------
EOF
tail -n +17 ../README.md \
| pandoc --from=markdown --to=rst \
| sed -E 's/```/`/; s/`` </ </' \
>> index.rst
source ../local/bin/activate
# Run sphinx in the virtualenv's python interpreter so it can import packages
# installed in the virtualenv.
python3 `which sphinx-build` -b html . _build/html