diff --git a/.gitignore b/.gitignore index 8583d22..a42b609 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules/ result +.lycheecache +.direnv/ diff --git a/flake.nix b/flake.nix index e0ff168..dbd9963 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,7 @@ buildInputs = (with pkgs; [ asciidoctor + pkgs.lychee nodejs shellcheck yq @@ -35,20 +36,35 @@ ]; }; - checks.grammar = - pkgs.runCommand "grammar-check" { - nativeBuildInputs = - (with pkgs; [ - nearley - nodejs - yq - ]) - ++ [ - nearley + checks = { + grammar = + pkgs.runCommand "grammar-check" { + nativeBuildInputs = + (with pkgs; [ + nearley + nodejs + yq + ]) + ++ [ + nearley + ]; + } '' + ${./0004-general-uri-scheme/data/test/uri-scheme-tester.sh} ${./0004-general-uri-scheme/data} + touch $out + ''; + + links = pkgs.testers.lycheeLinkCheck { + site = pkgs.lib.sources.sourceFilesBySuffices ./. [".md" ".adoc"]; + extraConfig = { + extensions = ["md" "adoc"]; + include_fragments = true; + exclude = [ + "^rad:.*$" + "^web\\+rad:.*$" + "^vscode:.*$" ]; - } '' - ${./0004-general-uri-scheme/data/test/uri-scheme-tester.sh} ${./0004-general-uri-scheme/data} - touch $out - ''; + }; + }; + }; }); } diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 0000000..14afa65 --- /dev/null +++ b/lychee.toml @@ -0,0 +1,12 @@ +extensions = ["md", "adoc"] +include_fragments = true +# Exclude custom URI schemes that lychee cannot resolve +exclude = [ + '^rad:', + '^web\+rad:', + '^vscode:', +] +include_mail = false +timeout = 20 +max_retries = 2 +retry_wait_time = 2