-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checking Links in published documentation #1759
Comments
This is configured via the ignore option in linkchecker.ini: foreman-documentation/guides/common/linkchecker.ini Lines 7 to 23 in eb0b825
As you can see, it ignores 6.11. In feb42e7 I turned it on for 3.1. #1750 is an effort to properly resolve it for master. You're (very) welcome to take over the effort. |
Still, not all the links are checked for the 3.1 branch as can be seen from the output above. Nevertheless I can take over #1750 if you wish, but the work will probably be postponed because I will be less active in the coming days. |
I'd recommend running |
I tested this on 3.1 for the Upgrading guide. Here are the commands that I used and the output:
According to this, there are quite a few URLs that didn't get checked by the linkchecker. |
If I strip off the $ diff -Nut <(linkchecker --verbose ../build/Upgrading_and_Updating/index-satellite.html | grep 'Real URL' | tr -s ' ' | cut -d' ' -f3 | sed 's/#.*//' | sort) <(grep -oE 'href="http[^"]+' ../build/Upgrading_and_Updating/index-satellite.html | sed -e 's/href="// ; s/#.*//' | sort -u)
INFO linkcheck.cmdline 2022-12-01 14:02:49,057 MainThread Checking intern URLs only; use --check-extern to check extern URLs.
--- /dev/fd/63 2022-12-01 14:02:48.886036197 +0100
+++ /dev/fd/62 2022-12-01 14:02:48.887036210 +0100
@@ -1,6 +1,3 @@
-file:///home/ekohl/dev/foreman-documentation/3.1/guides/build/Upgrading_and_Updating/index-satellite.html
-file:///js/nav.js
-file:///js/versions.js
https://access.redhat.com/articles/3664871
https://access.redhat.com/articles/4977891
https://access.redhat.com/articles/6393361 Can we close this? |
Sure. I realized later that link-check does not solve that problem either. |
I have noticed that despite having linkchecker we are getting bug reports about invalid links in the existing documentation. For example, BZ#2139221.
![image](https://user-images.githubusercontent.com/108661422/200533425-47df44ab-8f07-4577-86a1-e87a9edce491.png)
I have created a simple script that checks html files for links, validates them using curl, and returns any links for which the request returned any other code than 200 (meaning an error happened somewhere).
You can find the script here: https://github.com/adamlazik1/link-check
Instructions on installation and how to use it are in the README file.
I will appreciate any feedback, bug reports, or suggestions for improvement you may have.
Feel free to create PRs with improvements if you feel like it.
As a demostration of difference between link-check and linkchecker, I am attaching this picture:
This concerns Satellite 6.11 (Foreman 3.1) build of Configuring Load Balancer guide. You can see that there is not any invalid link detected by linkchecker but there is in fact one that points to non-existing page.
Naturally, link-check does cannot check links that point to guides that have not been published yet (Satellite build of Foreman 3.3. guides for example.).
The text was updated successfully, but these errors were encountered: