$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 build systems, where linkchecker is available $if not setenv GPORTBIN $abort.noError 'no linkchecker available' $if set noComp $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% * ignore warnings for permanent URLs (doi/urn) (#6298) * disable http-rate-limited warnings, as they are not in our control * disable http-redirected warnings, as they come up too frequently and do not indicate an error $onEcho > linkcheckerrc [filtering] checkextern = %checkextern% ignore = %ignore% ^https://doi.org ^https://nbn-resolving.de ^https://nbn-resolving.org ^http://www.amazon.com ^https://www.amazon.com ^https://www.youtube.com/user/GAMSLessons ^https://license.gams.com nofollow = ignorewarnings = http-redirected,http-rate-limited [output] status = 0 fileoutput = html [checking] sslverify=0 $offEcho * call linkchecker for docs and model libraries $set LINKCHECKERCALL python -c 'from linkcheck.command.linkchecker import linkchecker; linkchecker()' * on macOS, the docs are not in sysdir anymore, but in ../../../Resources/docs $if dexist '%gams.sysdir%../../../Resources/docs' $call sh -c "%LINKCHECKERCALL% -flinkcheckerrc '%gams.sysdir%../../../Resources/docs/index.html' '%gams.sysdir%'../../../Resources/*_ml/libhtml/index.html" $if not dexist '%gams.sysdir%../../../Resources/docs' $call sh -c "%LINKCHECKERCALL% -flinkcheckerrc '%gams.sysdir%docs/index.html' '%gams.sysdir%'/*_ml/libhtml/index.html" $if errorlevel 1 $abort 'broken links in docu, inspect linkchecker-out.html'