HTML checks
Restarting review https://review.opendev.org/c/starlingx/docs/+/773155 Adding htmlChecks.sh to tox.ini. Script will run post-build checks for HTML formatting issues not reported by sphinx. Per 773155 review of tox failure, updated tox.ini to pass script to bash. Script was executable in previous review but failed remote runs. Signed-off-by: Ron Stone <ronald.stone@windriver.com> Change-Id: I603c724fcac567006e20244cffa15ee2860a7b68
This commit is contained in:
parent
4c41786955
commit
75e96e3eff
|
@ -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)
|
3
tox.ini
3
tox.ini
|
@ -17,6 +17,9 @@ deps =
|
||||||
-r{toxinidir}/doc/requirements.txt
|
-r{toxinidir}/doc/requirements.txt
|
||||||
commands =
|
commands =
|
||||||
sphinx-build -a -E -W --keep-going -d doc/build/doctrees -b html doc/source doc/build/html {posargs}
|
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]
|
[testenv:api-ref]
|
||||||
deps = {[testenv:docs]deps}
|
deps = {[testenv:docs]deps}
|
||||||
|
|
Loading…
Reference in New Issue