checkLinks_linkchecker.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/sh
  2. # Check links in the generated documentation. This script runs on Linux and
  3. # assumes the "linkchecker" program to be installed.
  4. #
  5. requiredBaseDir="org.yakindu.sct.doc.user"
  6. #
  7. # Check whether this script is executed in the required base directory.
  8. #
  9. dir=`pwd`
  10. basedir=`basename ${dir}`
  11. if [ "${basedir}" != "${requiredBaseDir}" ]
  12. then
  13. echo "This script must be executed in the …/${requiredBaseDir} directory."
  14. echo "Please \"cd\" to the …/${requiredBaseDir} directory and retry!"
  15. exit 1
  16. fi
  17. #
  18. # Common options for both linkchecker runs:
  19. #
  20. commonOptions="--anchors --check-css --check-extern --check-html --recursion-level=1 --stdin"
  21. if [ "$1" = "--website" -o "$1" = "--both" ]
  22. then
  23. # Check links in the website documentation:
  24. find website -name "*.html" | \
  25. linkchecker ${commonOptions} \
  26. --ignore-url="PLUGINS_ROOT/org\.eclipse\.platform\.doc\.user/gettingStarted/qs-01\.htm" \
  27. --ignore-url="file:///.+com\.yakindu\.traceability\.help/website/fonts/" \
  28. --ignore-url="file://static.hsappstatic.net/social_shared/static-2.2815/img/followme/icon_twitter.png" \
  29. --ignore-url="file:///_hcms/raw-resource" \
  30. --ignore-url="file://info\.itemis\.com/hs-fs/hubfs/itemis_Logos/itemis-Marke-200.png" \
  31. --ignore-url="file://info.itemis.com/hs-fs/hubfs/Yakindu-Bildmarke.png" \
  32. --ignore-url="file://static.hsappstatic.net/social_shared/static-2.2815/img/.*" \
  33. --ignore-url="file://cdn2.hubspot.net/hub/" \
  34. --ignore-url="file://.+/com.yakindu.traceability.help/website/%7B%7B%20site_settings.favicon_src%20%7D%7D" \
  35. --ignore-url="file://.+/com.yakindu.traceability.help/website/%7B%7B%20get_public_template_url" \
  36. --ignore-url="file://.+/com.yakindu.traceability.help/user-guide/"
  37. elif [ "$1" = "--eclipsehelp" -o "$1" = "--both" ]
  38. then
  39. # Check links in the Eclipsehelp documentation:
  40. find help -name "*.html" | \
  41. linkchecker ${commonOptions} \
  42. --ignore-url="PLUGINS_ROOT/org\.eclipse\.platform\.doc\.user/gettingStarted/qs-01\.htm"
  43. else
  44. echo "Usage: $0 [ --website | --eclipsehelp | --both ]"
  45. fi