-
Notifications
You must be signed in to change notification settings - Fork 114
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
Link testing #12
Comments
htmlproofer does this https://github.com/gjtorikian/html-proofer Could be setup with travis. We do this for our jekyll site |
Looks like this npm script does it specifically for markdowns. https://www.npmjs.com/package/markdown-link-check If we want to start some automation on the repo then I guess node would be the way to go. Peter has some tools for auto generating the contents also. |
@PandelisZ that second library is really good, we could easily make a little node script with mocha which runs markdown-link-check on the main file. I'll get it done this afternoon and I'll try to hide it away in a directory so it doesn't clutter up the root. As you said we can then add a travis file and someone (maybe @joenash) can hook it up when they get a spare few moments. |
Not a problem, I'll get this sorted! Good idea |
I'll see about whipping up a quick test tomorrow morning and adding a PR |
Cause I'm evil and I haven't quite found a package that does it out on the web, I constructed a regex match for bullet points that fit the schema of
This is useful because as you saw with #10 sometimes mistakes can be made and also the format for links in markdown can be forgotten and entered in reverse. To avoid that we can check for the user. Here is the regex its self. I don't know why I went ahead with this but I did.
We could employ that to check that links submitted are in the correct format and provide valid urls and descriptions |
@PandelisZ I just shoved that into a regex tester to check if it works with sub-lists and got an error around (- )+([[])+([a-z])\w+]+\(+https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/=]*)+\)+( - )+([A-Za-z\-,\);.\(]+[\s])* |
Link decay is often a problem with large lists like these, what do we think about a daily build with travis which checks all the URL's return with a
200 OK
? Should be quite easy to write by parsing the readme into html and then cycling through all links making a request to each.A down side is it would probably be quite slow. To combat that we could configure it to only run daily and not be a requirement for PR's. Although that would make it easier for people to add urls which don't work in the first place.
The text was updated successfully, but these errors were encountered: