doc01.gms : runs linkchecker on offline documentation

Description

Run's a linkchecker on the documentation in %gams.sysdir%/docs.

Contributor: Jarungjit Parnjai, Stefan Vigerske, May 2015

  run only on systems where linkchecker is available
    (which does not do as on other platforms on SOX, but we know that so far we have no linkchecker there)

  checking links to external webpages takes times and is error prone, do this only on walt in licensed builds for now


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
*   (which does not do as on other platforms on SOX, but we know that so far we have no linkchecker there)
$if %system.buildcode% == SOX $exit
$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 walt in licensed builds for now
$set checkextern 0
$if not set DEMOSIZE $if %sysenv.HOSTNAME% == anton.gams.com $set checkextern 1

$onecho > linkcheckerrc
[filtering]
checkextern = %checkextern%
ignore = ^https://
  ^http://doi.org
nofollow =

[output]
status = 0
fileoutput = html
$offecho

* call linkchecker for docs and model libraries
$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'