build_docs.sh 781 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env bash
  2. ### Bash Environment Setup
  3. # http://redsymbol.net/articles/unofficial-bash-strict-mode/
  4. # https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
  5. # set -o xtrace
  6. set -o errexit
  7. set -o errtrace
  8. set -o nounset
  9. set -o pipefail
  10. IFS=$'\n'
  11. REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
  12. if [[ -f "$REPO_DIR/.venv/bin/activate" ]]; then
  13. source "$REPO_DIR/.venv/bin/activate"
  14. else
  15. echo "[!] Warning: No virtualenv presesnt in $REPO_DIR.venv"
  16. fi
  17. cd "$REPO_DIR"
  18. echo "[*] Fetching latest docs version"
  19. cd "$REPO_DIR/docs"
  20. git pull
  21. cd "$REPO_DIR"
  22. echo "[+] Building docs"
  23. sphinx-apidoc -o docs archivebox
  24. cd "$REPO_DIR/docs"
  25. make html
  26. # open docs/_build/html/index.html to see the output
  27. cd "$REPO_DIR"