forked from moveit/moveit2_tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
htmlproofer.sh
executable file
·37 lines (28 loc) · 1.33 KB
/
htmlproofer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -e
# Define some config vars
export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
export REPOSITORY_NAME=${PWD##*/}
echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
# Install htmlpoofer
gem install --user-install html-proofer -v 3.19.4 # newer 4.x requires different cmdline options
PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
# Install python dependencies
pip3 install --user --upgrade -r requirements.txt
# Clear out any previous builds
rm -rf build
# Test build with non-ROS wrapped Sphinx command to allow warnings and errors to be caught
sphinx-build -W -b html . build
# 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"
# Replace internal links with local file paths
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
htmlproofer ./build \
--only-4xx --check-html --http-status-ignore "429" \
--file-ignore ./build/genindex.html,./build/search.html \
--alt-ignore '/.*/' --url-ignore '#'
# Tell GitHub Pages (on deploy) to bypass Jekyll processing
touch build/.nojekyll