diff --git a/htmlChecks.sh b/htmlChecks.sh new file mode 100755 index 000000000..934642a7f --- /dev/null +++ b/htmlChecks.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Post-build checks on HTML go here. + +RED='\033[0;31m' +NC='\033[0m' # No Color + +cd doc/build + +# 1. Check for rST formatting issues that don't cause build warnings/errors +echo "Checking for \"grey bar\" formatting errors in output ..." +GREY_FILES=( $(grep -rl --include="*.html" "blockquote" .) ) +if [ ${#GREY_FILES[@]} != 0 ]; then + echo "Found ${#GREY_FILES[@]} file(s):" + for FILE in ${GREY_FILES[@]}; + do + echo -e "${RED}$FILE${NC}" + done + echo "Using a browser, locate vertical grey bars in the left margin of the above file(s), then correct the issue(s) in the cooresponding rST file(s)." + # Set -W to halt tox + if [[ $1 == "-W" ]]; then + exit 1 + fi +fi + +# 2. do - check for emdash before option (missing backticks) \ No newline at end of file diff --git a/tox.ini b/tox.ini index 8bf55d928..badcc37d1 100644 --- a/tox.ini +++ b/tox.ini @@ -17,6 +17,9 @@ deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W --keep-going -d doc/build/doctrees -b html doc/source doc/build/html {posargs} + bash htmlChecks.sh +whitelist_externals = bash + htmlChecks.sh [testenv:api-ref] deps = {[testenv:docs]deps}