diff --git a/build-github.zsh b/build-github.zsh new file mode 100755 index 0000000..a17f754 --- /dev/null +++ b/build-github.zsh @@ -0,0 +1,30 @@ +#!/bin/zsh + +# Should be run from the docs directory: (cd docs && ./build-github.zsh) + +REPO=$(dirname $(pwd)) +GH=_gh-pages + + +# Checkout the gh-pages branch, if necessary. +if [[ ! -d $GH ]]; then + git clone $REPO $GH + pushd $GH + git checkout -b gh-pages origin/gh-pages + popd +fi + +# Update and clean out the _gh-pages target dir. +pushd $GH && git pull && rm -rf * && popd + +# Make a clean build. +make clean dirhtml + +# Move the fresh build over. +cp -r _build/dirhtml/* $GH +cd $GH + +# Commit. +git add . +git commit -am "gh-pages build on $(date)" +git push origin gh-pages diff --git a/docs.rst b/docs.rst index fb4ca03..82f6b57 100644 --- a/docs.rst +++ b/docs.rst @@ -70,4 +70,12 @@ Here's a nice macro for creating headings:: Compiling Documentation ----------------------- -Playdoh hosts its documentation on github pages. +Playdoh hosts its documentation on `github pages +`_. When you change the docs, make sure +they still build properly and look all right locally:: + + cd docs && make html && open _build/html/index.html + +If they do, run a build and push it to gh-pages:: + + ./build-github.zsh