From fcfd56c00c12f7c683f223c30182ceaeccca6902 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Sun, 5 Oct 2025 13:07:57 +0200 Subject: [PATCH] docs: check init htmlproofer Checks integrity of internal links post-rendering for problems that might have slipped through we noticed a set of edge cases where the builtin link checking doesnt work --- docs/nix/flake-module.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/nix/flake-module.nix b/docs/nix/flake-module.nix index 7a94a4e37..2d70b9fc2 100644 --- a/docs/nix/flake-module.nix +++ b/docs/nix/flake-module.nix @@ -88,8 +88,12 @@ ; }; devShells.docs = self'.packages.docs.overrideAttrs (_old: { - nativeBuildInputs = - self'.devShells.default.nativeBuildInputs ++ self'.packages.docs.nativeBuildInputs; + nativeBuildInputs = [ + # Run: htmlproofer --disable-external + pkgs.html-proofer + ] + ++ self'.devShells.default.nativeBuildInputs + ++ self'.packages.docs.nativeBuildInputs; shellHook = '' ${self'.devShells.default.shellHook} git_root=$(git rev-parse --show-toplevel) @@ -113,5 +117,17 @@ deploy-docs = pkgs.callPackage ./deploy-docs.nix { inherit (config.packages) docs; }; inherit module-docs; }; + checks.docs-integrity = + pkgs.runCommand "docs-integrity" + { + nativeBuildInputs = [ pkgs.html-proofer ]; + } + '' + # External links should be avoided in the docs, because they often break + # and we cannot statically control them. Thus we disable checking them + htmlproofer --disable-external ${self'.packages.docs} + + touch $out + ''; }; }