I maintain testers.lycheeLinkCheck in Nixpkgs. Recently I've had some trouble with mdbook sites and I noticed that if --root-dir is not passed, lychee will report errors like:
Cannot resolve root-relative link '/': To resolve root-relative links in local files, provide a root dir
That's correct, but not great for sites that need to actively avoid root-relative links.
Would you be interested in a PR that allows this intent to be declared in the options?
--relocatable
Declare that the site must be mountable onto any path.
While this is the de facto default behavior, this option makes the error message explicit about the requirement.
This is the opposite of specifying `--root-dir`; they're mutually exclusive.
New UX
- Instead of failing, ask the user to elaborate:
Don't know how to resolve root-relative link '/'! If your site must be relocatable to any path, pass `--relocatable` or `relocatable = true` in the configuration. Otherwise, pass `--root-dir`.
- Either success, or, if
relocatable:
Root-relative links (starting with '/') are not allowed because this site should be relocatable to any path.
Context
I've prototyped this idea in NixOS/nixpkgs#520792 and that PR would solve the immediate problem for me, but I'd much prefer a built-in solution of course.
So
Does this match your design philosophy for lychee?
I maintain
testers.lycheeLinkCheckin Nixpkgs. Recently I've had some trouble with mdbook sites and I noticed that if--root-diris not passed, lychee will report errors like:That's correct, but not great for sites that need to actively avoid root-relative links.
Would you be interested in a PR that allows this intent to be declared in the options?
New UX
relocatable:Context
I've prototyped this idea in NixOS/nixpkgs#520792 and that PR would solve the immediate problem for me, but I'd much prefer a built-in solution of course.
So
Does this match your design philosophy for lychee?