From e7f30ad157cf0973adb8b1d1bd853421084c3f5d Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 18 Dec 2025 02:13:22 +0100 Subject: [PATCH] helix: fix build with mdbook 0.5 Update helix documentation build for mdbook 0.5 compatibility. Changes: - Replace deprecated {{#previous}}/{{#next}} helpers with {{#if}} blocks - Update link references from {{link}} to {{previous.link}}/{{next.link}} - Escape HTML tags in command descriptions to prevent markdown parsing errors - Fix book-html path in postInstall (../book-html instead of book-html) The mdbook 0.5 release changed navigation helpers from block helpers to simple objects, requiring template syntax updates in index.hbs. --- pkgs/by-name/he/helix/mdbook-0.5-support.patch | 14 ++++++++++++++ pkgs/by-name/he/helix/package.nix | 14 +++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/he/helix/mdbook-0.5-support.patch diff --git a/pkgs/by-name/he/helix/mdbook-0.5-support.patch b/pkgs/by-name/he/helix/mdbook-0.5-support.patch new file mode 100644 index 000000000000..11591af15937 --- /dev/null +++ b/pkgs/by-name/he/helix/mdbook-0.5-support.patch @@ -0,0 +1,14 @@ +--- a/helix-term/src/commands.rs ++++ b/helix-term/src/commands.rs +@@ -424,9 +424,9 @@ impl MappableCommand { + add_newline_below, "Add newline below", + goto_type_definition, "Goto type definition", + goto_implementation, "Goto implementation", +- goto_file_start, "Goto line number else file start", ++ goto_file_start, "Goto line number <n> else file start", + goto_file_end, "Goto file end", +- extend_to_file_start, "Extend to line number else file start", ++ extend_to_file_start, "Extend to line number <n> else file start", + extend_to_file_end, "Extend to file end", + goto_file, "Goto files/URLs in selections", + goto_file_hsplit, "Goto files in selections (hsplit)", diff --git a/pkgs/by-name/he/helix/package.nix b/pkgs/by-name/he/helix/package.nix index c4ba2f0f3634..890b554134c2 100644 --- a/pkgs/by-name/he/helix/package.nix +++ b/pkgs/by-name/he/helix/package.nix @@ -1,5 +1,6 @@ { fetchzip, + fetchpatch, lib, rustPlatform, mdbook, @@ -25,6 +26,17 @@ rustPlatform.buildRustPackage (final: { stripRoot = false; }; + patches = [ + # Support mdbook 0.5.x: escape HTML tags in command descriptions + ./mdbook-0.5-support.patch + ]; + + postPatch = '' + # mdbook 0.5 uses asset hashing for CSS/JS files + # Remove custom theme to use default mdbook theme with correct asset references + rm -f book/theme/index.hbs + ''; + cargoHash = "sha256-Mf0nrgMk1MlZkSyUN6mlM5lmTcrOHn3xBNzmVGtApEU="; nativeBuildInputs = [ @@ -49,7 +61,7 @@ rustPlatform.buildRustPackage (final: { mkdir -p $out/share/{applications,icons/hicolor/256x256/apps} cp contrib/Helix.desktop $out/share/applications cp contrib/helix.png $out/share/icons/hicolor/256x256/apps - cp -r book-html $doc/share/doc/$name + cp -r ../book-html $doc/share/doc/$name ''; nativeInstallCheckInputs = [