Skip to content

Commit

Permalink
Update htmlproofer.sh script to not bark at warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-bass committed Nov 17, 2024
1 parent f55f97c commit f1093b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions htmlproofer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rm -rf build
# Build API docs
mkdir -p build/html
pushd build/html
git clone https://github.com/ros-planning/moveit2 -b $MOVEIT_BRANCH --depth 1
git clone https://github.com/moveit/moveit2 -b $MOVEIT_BRANCH --depth 1
pushd moveit2
sed -i "s/HTML_EXTRA_STYLESHEET =.*/HTML_EXTRA_STYLESHEET = ..\/..\/..\/theme.css/g" Doxyfile
DOXYGEN_OUTPUT_DIRECTORY="../api" doxygen
Expand All @@ -30,19 +30,21 @@ rm -rf moveit2
popd

# Test build with non-ROS wrapped Sphinx command to allow warnings and errors to be caught
sphinx-build -W -b html . build/html
# TODO: Re-add the -W flag so that all warnings are treated as errors.
sphinx-build -b html . build/html

# Replace Edit on Github links with local file paths
grep -rl 'https:\/\/github.com\/ros-planning\/moveit2_tutorials\/blob\/main\/' ./build/ | \
xargs sed -i "s|https://github.com/ros-planning/moveit2_tutorials/blob/main/|file://$PWD|g"
grep -rl 'https:\/\/github.com\/moveit\/moveit2_tutorials\/blob\/main\/' ./build/ | \
xargs sed -i "s|https://github.com/moveit/moveit2_tutorials/blob/main/|file://$PWD|g"

# Replace internal links with local file paths
grep -rl 'https:\/\/moveit.picknik.ai\/humble\/' ./build/ | \
xargs sed -i "s|https://moveit.picknik.ai/humble/|file://$PWD|g"
grep -rl 'https:\/\/moveit.picknik.ai\/rolling\/' ./build/ | \
xargs sed -i "s|https://moveit.picknik.ai/rolling/|file://$PWD|g"

# Run HTML tests on generated build output to check for 404 errors, etc
# 429 or 403 - happens when GitHub rate-limits requests
htmlproofer ./build \
--only-4xx --check-html --http-status-ignore "429" \
--only-4xx --check-html --http-status-ignore "429" --http-status-ignore "403" \
--file-ignore ./build/html/genindex.html,./build/html/search.html,/html/api/ \
--alt-ignore '/.*/' --url-ignore '#'

Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pip
docutils==0.18.1
docutils
sphinx>=5.0.0
sphinx-tabs==3.4.4
sphinx-tabs
sphinx-multiversion
sphinx-rtd-theme
sphinx-copybutton
sphinxcontrib-doxylink
sphinxcontrib-doxylink@git+https://github.com/sea-bass/doxylink.git@fix-parse-tag-file

0 comments on commit f1093b3

Please sign in to comment.