diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-25 08:25:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-25 08:25:33 +0400 |
commit | 50a9454e0fae5842b9f16a48e085396cc1fd0e3c (patch) | |
tree | 88f2e2122bfd3745e47aba7752a2dccc750c7dba /doc/python_api/sphinx_doc_gen.sh | |
parent | 5f66f37e225eb87532374af6c495a409da4ece66 (diff) |
move wiki api intro and overview docs into the api reference docs.
Updated docs since some parts still were from beta still.
Diffstat (limited to 'doc/python_api/sphinx_doc_gen.sh')
-rwxr-xr-x | doc/python_api/sphinx_doc_gen.sh | 66 |
1 files changed, 50 insertions, 16 deletions
diff --git a/doc/python_api/sphinx_doc_gen.sh b/doc/python_api/sphinx_doc_gen.sh index a3befe1b7cb..f7319876a37 100755 --- a/doc/python_api/sphinx_doc_gen.sh +++ b/doc/python_api/sphinx_doc_gen.sh @@ -3,11 +3,21 @@ # bash source/blender/python/doc/sphinx_doc_gen.sh # ssh upload means you need an account on the server + +# ---------------------------------------------------------------------------- +# Upload vars + +# disable for testing +DO_UPLOAD=true + BLENDER="./blender.bin" SSH_USER="ideasman42" SSH_HOST=$SSH_USER"@emo.blender.org" SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation" # blender_python_api_VERSION, added after +# ---------------------------------------------------------------------------- +# Blender Version & Info + # 'Blender 2.53 (sub 1) Build' --> '2_53_1' as a shell script. # "_".join(str(v) for v in bpy.app.version) # custom blender vars @@ -28,28 +38,52 @@ SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION SPHINXBASE=doc/python_api/ + +# ---------------------------------------------------------------------------- +# Generate reStructuredText (blender/python only) + # dont delete existing docs, now partial updates are used for quick builds. $BLENDER --background --factory-startup --python $SPHINXBASE/sphinx_doc_gen.py -# html -sphinx-build $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out -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/ +# ---------------------------------------------------------------------------- +# Generate HTML (sphinx) -## 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' +sphinx-build -n -b html $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out -# 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' -# pdf -sphinx-build -b latex $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out -cd $SPHINXBASE/sphinx-out -make -cd - +# ---------------------------------------------------------------------------- +# Generate PDF (sphinx/laytex) -# rename so local PDF has matching name. +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 -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 + +# ---------------------------------------------------------------------------- +# 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: " +echo " html:" $SPHINXBASE/sphinx-out/contents.html +echo " pdf:" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
\ No newline at end of file |