remove include paths which dont exist, fix for doc upload script which was getting...
[blender-staging.git] / doc / python_api / sphinx_doc_gen.sh
1 #!/bin/sh
2 # run from the blender source dir
3 #   bash source/blender/python/doc/sphinx_doc_gen.sh
4 # ssh upload means you need an account on the server
5
6 BLENDER="./blender.bin"
7 SSH_HOST="ideasman42@emo.blender.org"
8 SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation" # blender_python_api_VERSION, added after
9
10 # sed string from hell, 'Blender 2.53 (sub 1) Build' --> '2_53_1'
11 # "_".join(str(v) for v in bpy.app.version)
12 # custom blender vars
13 blender_srcdir=$(dirname $0)/../../
14 blender_version=$(grep BLENDER_VERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | tr -dc 0-9)
15 blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | tr -dc 0-9)
16 BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
17
18 SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
19
20 SPHINXBASE=doc/python_api/
21
22 # dont delete existing docs, now partial updates are used for quick builds.
23 $BLENDER --background --python $SPHINXBASE/sphinx_doc_gen.py
24
25 # html
26 sphinx-build $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
27 cp $SPHINXBASE/sphinx-out/contents.html $SPHINXBASE/sphinx-out/index.html
28 ssh ideasman42@emo.blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*'
29 rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
30
31 # pdf
32 sphinx-build -b latex $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
33 cd $SPHINXBASE/sphinx-out
34 make
35 cd -
36 rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/contents.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf