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.
This commit is contained in:
@@ -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 <n> 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<n> 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)",
|
||||
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user