#!/bin/bash # Set paths relative to the root directory (.) source_path=$(readlink -f ./docsource/source/) docs_path=$(readlink -f ./docs/) red='\033[0;31m' cyan='\033[0;36m' nc='\033[0m' printf "${cyan}Cleaning${nc} docs and build directories.\n" find ./docs -mindepth 1 -delete find ./docsource/build -mindepth 1 -delete printf "${cyan}Generating${nc} sphinx build.\n" sphinx-build -b html $source_path ./docsource/build printf "${cyan}Prepping${nc} for release.\n" cp -r ./docsource/build/* ./docs/ touch ./docs/.nojekyll printf "${cyan}Cleaning${nc} up and setting proper permissions\n" find ./docs/ -type d -exec chmod 755 {} \; find ./docs/ -type f -exec chmod 644 {} \; find ./docsource/build -mindepth 1 -delete printf "Documentation ${cyan}ready for release${nc} in: ${red}${docs_path}${nc}\n"