merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# run from the blender source dir
|
|
|
|
# bash source/blender/python/doc/sphinx_doc_gen.sh
|
2010-05-03 15:52:15 +00:00
|
|
|
# ssh upload means you need an account on the server
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
|
2011-08-25 04:25:33 +00:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Upload vars
|
|
|
|
|
|
|
|
# disable for testing
|
|
|
|
DO_UPLOAD=true
|
2011-09-15 16:15:24 +00:00
|
|
|
DO_EXE_BLENDER=true
|
|
|
|
DO_OUT_HTML=true
|
|
|
|
DO_OUT_PDF=true
|
|
|
|
|
2011-08-25 04:25:33 +00:00
|
|
|
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
BLENDER="./blender.bin"
|
2011-02-06 10:18:20 +00:00
|
|
|
SSH_USER="ideasman42"
|
|
|
|
SSH_HOST=$SSH_USER"@emo.blender.org"
|
2010-09-03 09:21:40 +00:00
|
|
|
SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation" # blender_python_api_VERSION, added after
|
|
|
|
|
2011-08-25 04:25:33 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Blender Version & Info
|
|
|
|
|
2011-02-06 10:18:20 +00:00
|
|
|
# 'Blender 2.53 (sub 1) Build' --> '2_53_1' as a shell script.
|
2010-09-03 09:21:40 +00:00
|
|
|
# "_".join(str(v) for v in bpy.app.version)
|
2010-09-30 10:51:36 +00:00
|
|
|
# custom blender vars
|
2010-10-13 10:42:33 +00:00
|
|
|
blender_srcdir=$(dirname $0)/../../
|
2011-04-01 15:13:58 +00:00
|
|
|
blender_version=$(grep "BLENDER_VERSION\s" $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
|
|
|
|
blender_version_char=$(grep BLENDER_VERSION_CHAR $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
|
|
|
|
blender_version_cycle=$(grep BLENDER_VERSION_CYCLE $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
|
|
|
|
blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
|
|
|
|
|
|
|
|
if [ "$blender_version_cycle" == "release" ]
|
|
|
|
then
|
|
|
|
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"
|
|
|
|
else
|
|
|
|
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
|
|
|
|
fi
|
2010-09-30 10:51:36 +00:00
|
|
|
|
2010-09-03 09:21:40 +00:00
|
|
|
SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
|
2011-09-15 16:15:24 +00:00
|
|
|
SPHINXBASE=doc/python_api
|
2010-10-13 10:42:33 +00:00
|
|
|
|
2011-08-25 04:25:33 +00:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Generate reStructuredText (blender/python only)
|
|
|
|
|
2011-09-15 16:15:24 +00:00
|
|
|
if $DO_EXE_BLENDER ; then
|
|
|
|
# dont delete existing docs, now partial updates are used for quick builds.
|
|
|
|
$BLENDER --background --factory-startup --python $SPHINXBASE/sphinx_doc_gen.py
|
|
|
|
fi
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
|
2011-04-13 14:43:11 +00:00
|
|
|
|
2011-08-25 04:25:33 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Generate HTML (sphinx)
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
|
2011-09-15 16:15:24 +00:00
|
|
|
if $DO_OUT_HTML ; then
|
|
|
|
# sphinx-build -n -b html $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
|
|
|
|
|
|
|
|
# annoying bug in sphinx makes it very slow unless we do this. should report.
|
|
|
|
cd $SPHINXBASE
|
|
|
|
sphinx-build -n -b html sphinx-in sphinx-out
|
|
|
|
cd -
|
|
|
|
fi
|
2011-07-28 03:08:35 +00:00
|
|
|
|
2011-02-06 10:18:20 +00:00
|
|
|
|
2011-08-25 04:25:33 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Generate PDF (sphinx/laytex)
|
2011-02-06 10:18:20 +00:00
|
|
|
|
2011-09-15 16:15:24 +00:00
|
|
|
if $DO_OUT_PDF ; then
|
|
|
|
sphinx-build -n -b latex $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
|
|
|
|
make -C $SPHINXBASE/sphinx-out
|
|
|
|
mv $SPHINXBASE/sphinx-out/contents.pdf $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
|
|
|
|
fi
|
2011-08-25 04:25:33 +00:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Upload to blender servers, comment this section for testing
|
|
|
|
|
|
|
|
if $DO_UPLOAD ; then
|
|
|
|
|
|
|
|
cp $SPHINXBASE/sphinx-out/contents.html $SPHINXBASE/sphinx-out/index.html
|
|
|
|
ssh $SSH_USER@emo.blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*'
|
|
|
|
rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
|
|
|
|
|
|
|
|
## symlink the dir to a static URL
|
|
|
|
#ssh $SSH_USER@emo.blender.org 'rm '$SSH_UPLOAD'/250PythonDoc && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/250PythonDoc'
|
|
|
|
|
|
|
|
# better redirect
|
|
|
|
ssh $SSH_USER@emo.blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/250PythonDoc/index.html'
|
|
|
|
|
|
|
|
# rename so local PDF has matching name.
|
|
|
|
rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Print some useful text
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Finished! view the docs from: "
|
2011-09-15 16:15:24 +00:00
|
|
|
if $DO_OUT_HTML ; then echo " html:" $SPHINXBASE/sphinx-out/contents.html ; fi
|
|
|
|
if $DO_OUT_PDF ; then echo " pdf:" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf ; fi
|