Skip to content

Instantly share code, notes, and snippets.

@binaryaaron
Last active January 9, 2018 17:39
Show Gist options
  • Save binaryaaron/fb69997858c4e25451d586fee32c5f4f to your computer and use it in GitHub Desktop.
Save binaryaaron/fb69997858c4e25451d586fee32c5f4f to your computer and use it in GitHub Desktop.

Revisions

  1. Aaron Gonzales revised this gist Jan 9, 2018. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions build_sphinx_docs.sh
    Original file line number Diff line number Diff line change
    @@ -19,17 +19,17 @@ fi

    pwd
    echo "removing current files"
    rm -rf *.egg-info
    rm -rf ./*.egg-info
    git pull origin gh-pages
    rm -r *.html *.js
    rm -r ./*.html ./*.js ./_modules ./_sources ./_static
    touch .nojekyll
    git checkout $BRANCH_NAME docs $REPO_NAME README.md
    git checkout $BRANCH_NAME docs $REPO_NAME README.rst
    # need to do this step because the readme will be overwritten
    pandoc -i README.md -o docs/source/README.rst
    cp README.rst docs/source/README.rst
    mv docs/* .
    make html
    mv -fv build/html/* ./
    rm -r $REPO_NAME docs build Makefile source README.* __pycache__/
    rm -r $REPO_NAME docs build Makefile source README.md __pycache__/ dist/
    echo "--------------------------------------------------------------------"
    echo " docs built; please review these changes and then run the following:"
    echo "--------------------------------------------------------------------"
  2. Aaron Gonzales revised this gist Aug 24, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion build_sphinx_docs.sh
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ pandoc -i README.md -o docs/source/README.rst
    mv docs/* .
    make html
    mv -fv build/html/* ./
    rm -r $REPO_NAME docs build Makefile source README.md __pycache__/
    rm -r $REPO_NAME docs build Makefile source README.* __pycache__/
    echo "--------------------------------------------------------------------"
    echo " docs built; please review these changes and then run the following:"
    echo "--------------------------------------------------------------------"
  3. Aaron Gonzales created this gist Aug 23, 2017.
    39 changes: 39 additions & 0 deletions build_sphinx_docs.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    #!/bin/bash

    if [ $# -ne 2 ]; then
    echo "Error: Please provide a branch name and repo name from which documentation will be built";
    exit 1
    fi

    BRANCH_NAME=$1
    REPO_NAME=$2

    echo "Building documentation from $BRANCH_NAME"
    echo "checking out gh-pages"
    if ! git checkout gh-pages
    then
    echo >&2 "checkout of gh-pages branch failed; please ensure you have local changes commited prior to running this script "
    echo "exiting"
    exit 1
    fi

    pwd
    echo "removing current files"
    rm -rf *.egg-info
    git pull origin gh-pages
    rm -r *.html *.js
    touch .nojekyll
    git checkout $BRANCH_NAME docs $REPO_NAME README.md
    # need to do this step because the readme will be overwritten
    pandoc -i README.md -o docs/source/README.rst
    mv docs/* .
    make html
    mv -fv build/html/* ./
    rm -r $REPO_NAME docs build Makefile source README.md __pycache__/
    echo "--------------------------------------------------------------------"
    echo " docs built; please review these changes and then run the following:"
    echo "--------------------------------------------------------------------"
    echo git add -A
    echo git commit -m \"Generated gh-pages for `git log master -1 --pretty=short --abbrev-commit | grep commit`\"
    echo git push origin gh-pages
    echo git checkout $BRANCH_NAME