Skip to content
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

Add automated link checker #34

Open
froschdesign opened this issue Apr 26, 2021 · 6 comments
Open

Add automated link checker #34

froschdesign opened this issue Apr 26, 2021 · 6 comments

Comments

@froschdesign
Copy link
Member

Feature Request

Beside the Markdown linting it would be great if we can check all the links in the Markdown files.

Q A
New Feature yes
BC Break no

Summary

A potential candidate would be markdown-link-check which can be installed via npm.

@froschdesign
Copy link
Member Author

Related to laminas/documentation#16

@gsteel
Copy link
Member

gsteel commented Dec 16, 2022

This tool doesn't support globbing, but I managed to run it out of docker with find with something like find ./docs/book -name \*.md -exec docker run -v ${PWD}:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable /tmp/{} \;

Because it's one file per run, there's no overall return and getting the output into GHA will be interesting.

Not sure how to proceed with this…

@froschdesign
Copy link
Member Author

@gsteel
Thank you for the testing. 👍🏻

Maybe this one: https://github.com/marketplace/actions/lychee-broken-link-checker

@gsteel
Copy link
Member

gsteel commented Dec 16, 2022

That's more like it. For i18n:

lychee docs/book -f json
{
  "total": 62,
  "successful": 61,
  "failures": 1,
  "unknown": 0,
  "timeouts": 0,
  "redirects": 0,
  "excludes": 0,
  "errors": 0,
  "cached": 0,
  "fail_map": {
    "docs/book/view-helpers/plural.md": [
      {
        "url": "https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals",
        "status": "Failed: Network error"
      }
    ]
  }
}

@gsteel
Copy link
Member

gsteel commented Dec 16, 2022

It's also a lot faster…

@froschdesign
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants