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 = [