forked from fastai/fastai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checklink-docs-local.sh
executable file
·28 lines (20 loc) · 1.01 KB
/
checklink-docs-local.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
#!/bin/bash
# check links and anchors of docs.fast.ai, but locally as fastai_docs/docs/ dir
# make sure to run tools/build-docs
# usage:
# ./checklink-docs-local.sh
cur=`pwd`
base=`dirname "$cur"`
log="checklink-docs-local.log"
site="docs/_site/"
echo -e "\n\n*** Updating docs/_site/"
cd ../docs
bundle exec jekyll build
cd -
echo -e "\n\n\n*** Checking docs.fast.ai against local fs at $base/$site"
echo "Logging into $log"
echo "This will take a few minutes. The process will be silent unless problems are encountered"
# have to hack the urls using a modified masquerade feature to support full regex in the argument.
./fastai-checklink --depth 50 --quiet --broken -e --timeout 60 --connection-cache 3 --exclude "github.com|test.pypi.org|ycombinator.com|anaconda.org|google.com|microsoft.com" --masquerade "file:///(?=[^/]+.html) file://$base/$site" ../$site | tee "$log"
# the script will give no output if all is good, so let's give a clear indication of success
if [[ ! -s $log ]]; then echo "No broken links were found"; fi