offer the Nix manual as a single page again (#997)

This commit is contained in:
Valentin Gagarin 2024-06-13 11:39:13 +02:00 committed by GitHub
parent 6cdcc8d14f
commit c2be69105c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -49,6 +49,10 @@ let
if [[ -f ${nix.doc}/share/doc/nix/manual/_redirects ]]; then
sed '/^#/d;/^$/d;s#^\(.*\) \(.*\) #/manual/nix/${version}\1 /manual/nix/${version}\2 #g' ${nix.doc}/share/doc/nix/manual/_redirects >> $out/_redirects
fi
# provide a single-page view from mdBook's print feature.
# this is hacky but cheap and does work.
sed -z 's|\s*window\.addEventListener(\x27load\x27, function() {\s*window\.setTimeout(window.print, 100);\s*});||g' ${nix.doc}/share/doc/nix/manual/print.html > $out/manual/nix/${version}/nix-${version}.html
'';
# Redirects from mutable URLs like /manual/nix/latest/... to /manual/nix/2.21/...
mutableRedirect = mutable: immutable: ''

View File

@ -30,19 +30,19 @@ The Nix reference manual is available for multiple versions:
Development build from the `master` branch of the [Nix repository](https://github.com/NixOS/nix)
- [Nix @nix-latest@](https://nix.dev/manual/nix/latest/)
- [Nix @nix-latest@](https://nix.dev/manual/nix/latest/) ([single page](https://nix.dev/manual/nix/latest/nix-@nix-latest@.html))
Latest Nix release
- [Nix @nix-rolling@](https://nix.dev/manual/nix/rolling/)
- [Nix @nix-rolling@](https://nix.dev/manual/nix/rolling/) ([single page](https://nix.dev/manual/nix/latest/nix-@nix-rolling@.html))
Shipped with the rolling release of {term}`Nixpkgs` and {term}`NixOS`
- [Nix @nix-stable@](https://nix.dev/manual/nix/stable/)
- [Nix @nix-stable@](https://nix.dev/manual/nix/stable/) ([single page](https://nix.dev/manual/nix/latest/nix-@nix-stable@.html))
Shipped with the latest stable release of {term}`Nixpkgs` and {term}`NixOS`: @nixpkgs-stable@
Shipped with the current stable release of {term}`Nixpkgs` and {term}`NixOS`: @nixpkgs-stable@
- [Nix @nix-prev-stable@](https://nix.dev/manual/nix/prev-stable/)
- [Nix @nix-prev-stable@](https://nix.dev/manual/nix/prev-stable/) ([single page](https://nix.dev/manual/nix/latest/nix-@nix-prev-stable@.html))
Shipped with the previous stable release of {term}`Nixpkgs` and {term}`NixOS`: @nixpkgs-prev-stable@