Description
Run's a linkchecker on the documentation in %gams.sysdir%/docs. Contributor: Jarungjit Parnjai, Stefan Vigerske, May 2015
Small Model of Type : GAMS
Category : GAMS Test library
Main file : doc01.gms
$title runs linkchecker on offline documentation (DOC01,SEQ=681)
$onText
Run's a linkchecker on the documentation in %gams.sysdir%/docs.
Contributor: Jarungjit Parnjai, Stefan Vigerske, May 2015
$offText
* run only on systems where linkchecker is available
$call sh -c "which linkchecker"
$if errorlevel 1 $abort.noError 'no linkchecker available'
* checking links to external webpages takes times and is error prone, do this only on anton in licensed builds for now
$set checkextern 0
$if not set DEMOSIZE $if %sysenv.GHOST% == anton.gams.com $set checkextern 1
* if not building master or distXX, then do not check links to external webpages
* (we are probably in a feature or bugfix branch where we test some solver update)
$if not %sysenv.GBRANCHNAME% == master $if not %sysenv.GBRANCHNAME% == dist%sysenv.GVERSIONMAJOR% $set checkextern 0
$set ignore
$if NOT %system.isAlphaBeta% == 0 $set ignore ^https://www.gams.com/%sysenv.DIST%
* 2020-06-26: skip https://www.scipopt.org because of SSL certification issues
$onEcho > linkcheckerrc
[filtering]
checkextern = %checkextern%
ignore = %ignore%
^http://doi.org
^http://www.amazon.com
^https://www.amazon.com
^https://www.scipopt.org
nofollow =
[output]
status = 0
fileoutput = html
[checking]
sslverify=0
$offEcho
* call linkchecker for docs and model libraries
* on Mac OS X, the docs are not in sysdir anymore, but in ../../../Resources/docs
$if dexist '%gams.sysdir%../../../Resources/docs' $call sh -c "linkchecker -flinkcheckerrc '%gams.sysdir%../../../Resources/docs/index.html' '%gams.sysdir%'../../../Resources/*_ml/libhtml/index.html"
$if not dexist '%gams.sysdir%../../../Resources/docs' $call sh -c "linkchecker -flinkcheckerrc '%gams.sysdir%docs/index.html' '%gams.sysdir%'/*_ml/libhtml/index.html"
$if errorlevel 1 $abort 'broken links in docu, inspect linkchecker-out.html'