NyuB / yadladoc

Documentation code snippets maintenance
5 stars 0 forks source link

Dead links: detect unreachable remote urls #2

Open NyuB opened 3 months ago

NyuB commented 3 months ago

In addition to checking code snippets, yadladoc could detect dead links

This issue proposes to detect links that refers to urls not reachable (unknown host, or returning an HTTP error like a 404)

Given the following markdown in a README.md:

[this host does not exist](https://definitely.not.real)

[this resource cannot be found](https://google.com/definitelynotreal)

[this is ok](https://google.com/)

When running yadladoc check, then it should display the invalid link and exit with an error code:

  $ java -jar ydoc.jar README.md
  Error [DeadLink]: https://definitely.not.real is unreachable
  Error [DeadLink]: https://google.com/definitelynotreal is unreachable
  [3]

Behaviour in run mode is open to discussion.