-
Notifications
You must be signed in to change notification settings - Fork 28
/
make_docs.sh
19 lines (15 loc) · 904 Bytes
/
make_docs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
set -e
# Set up docs folder
sphinx-quickstart --sep --dot _ --language en --suffix .rst --master index --makefile --batchfile --use-make-mode --author "Luca Fiorito" --project "SANDY API" -v 1 --release 0 --ext-autodoc --ext-doctest --ext-githubpages --ext-mathjax --extensions numpydoc api_docs
# Change configuration file
sed -i '13i\ sandy' api_docs/source/index.rst
sed -i "s/alabaster/sphinx_rtd_theme/" api_docs/source/conf.py
# add folder with sources
sed -i '1 i\import os\nimport sys\nsys.path.insert(0, os.path.abspath(os.path.join("..", "..")))\nsys.path.insert(0, os.path.abspath(os.path.join("..", "..", "sandy")))\nsys.path.insert(0, os.path.abspath("../"))\nprint(sys.path)' api_docs/source/conf.py
cat api_docs/source/conf.py
ls sandy
pwd
# Create rst files
sphinx-apidoc --separate --force --module-first -o api_docs/source sandy
# Run make
[[ -n $1 ]] && (cd api_docs && make $1)