Skip to content

Commit e7f30ad

Browse files
committed
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.
1 parent 0768ca2 commit e7f30ad

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- a/helix-term/src/commands.rs
2+
+++ b/helix-term/src/commands.rs
3+
@@ -424,9 +424,9 @@ impl MappableCommand {
4+
add_newline_below, "Add newline below",
5+
goto_type_definition, "Goto type definition",
6+
goto_implementation, "Goto implementation",
7+
- goto_file_start, "Goto line number <n> else file start",
8+
+ goto_file_start, "Goto line number &lt;n&gt; else file start",
9+
goto_file_end, "Goto file end",
10+
- extend_to_file_start, "Extend to line number<n> else file start",
11+
+ extend_to_file_start, "Extend to line number &lt;n&gt; else file start",
12+
extend_to_file_end, "Extend to file end",
13+
goto_file, "Goto files/URLs in selections",
14+
goto_file_hsplit, "Goto files in selections (hsplit)",

pkgs/by-name/he/helix/package.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
fetchzip,
3+
fetchpatch,
34
lib,
45
rustPlatform,
56
mdbook,
@@ -25,6 +26,17 @@ rustPlatform.buildRustPackage (final: {
2526
stripRoot = false;
2627
};
2728

29+
patches = [
30+
# Support mdbook 0.5.x: escape HTML tags in command descriptions
31+
./mdbook-0.5-support.patch
32+
];
33+
34+
postPatch = ''
35+
# mdbook 0.5 uses asset hashing for CSS/JS files
36+
# Remove custom theme to use default mdbook theme with correct asset references
37+
rm -f book/theme/index.hbs
38+
'';
39+
2840
cargoHash = "sha256-Mf0nrgMk1MlZkSyUN6mlM5lmTcrOHn3xBNzmVGtApEU=";
2941

3042
nativeBuildInputs = [
@@ -49,7 +61,7 @@ rustPlatform.buildRustPackage (final: {
4961
mkdir -p $out/share/{applications,icons/hicolor/256x256/apps}
5062
cp contrib/Helix.desktop $out/share/applications
5163
cp contrib/helix.png $out/share/icons/hicolor/256x256/apps
52-
cp -r book-html $doc/share/doc/$name
64+
cp -r ../book-html $doc/share/doc/$name
5365
'';
5466

5567
nativeInstallCheckInputs = [

0 commit comments

Comments
 (0)