From 331fa9b35208e284a4d5279fe4b83c926b990506 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Wed, 24 Jul 2024 15:10:21 -0400 Subject: [PATCH] update lix docs --- overlays/lix-docs/default.nix | 1 + packages/lix-docs/default.nix | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/overlays/lix-docs/default.nix b/overlays/lix-docs/default.nix index 9d75a8b..752ea60 100644 --- a/overlays/lix-docs/default.nix +++ b/overlays/lix-docs/default.nix @@ -1,6 +1,7 @@ { channels, ... }: final: prev: { lix-docs = channels.nixpkgs.lix.overrideAttrs { + pname = "lix-docs"; postBuild = '' TERM=dumb ninja doc/manual/markdown ''; diff --git a/packages/lix-docs/default.nix b/packages/lix-docs/default.nix index 2d8f709..9700500 100644 --- a/packages/lix-docs/default.nix +++ b/packages/lix-docs/default.nix @@ -10,7 +10,8 @@ let s = "${f} sed -i"; in stdenv.mkDerivation { - inherit (lix-docs) pname version; + inherit (lix-docs) version; + pname = "lix-docs-md"; src = lix-docs.src; @@ -55,6 +56,7 @@ stdenv.mkDerivation { ${s} '8s/\w/\u&/' {} \; ${s} '8s/$/\./' {} \; ${f} ex -c '1,5m9' -c w -c q {} \; + ${s} 's!../command-ref!\./!g' {} \; popd mv new-cli New-CLI # Fixup all non-nix3 commands @@ -68,8 +70,11 @@ stdenv.mkDerivation { # Fixup Nix-env pushd nix-env find . -type f -name "*.md" -exec bash -c 'defaultFix "$0"' {} \; - sed -i 's!\./nix-env!\./!g' index.md - sed -i 's!../Command-Reference/!\./!g' index.md + ${s} 's!../command-ref!\.!g' {} \; + sed -i 's!\./nix-env!\.!g' index.md + sed -i 's!\./files!\.\./files!g' index.md + sed -i 's!\./new-cli!\.\./new-cli!g' index.md + sed -i 's!\.\./language!\.\./\.\./language!g' index.md popd bash -c defaultFix conf-file.md popd @@ -117,12 +122,15 @@ stdenv.mkDerivation { find . -type f -name "*.md" -exec sed -i 's/advanced-topics/Advanced-Topics/g' {} \; find . -type f -name "*.md" -exec sed -i 's/command-ref/Command-Reference/g' {} \; find . -type f -name "*.md" -exec sed -i 's/package-management/Package-Management/g' {} \; + find . -type f -name "*.md" -exec sed -i 's!installation/installation\.md!installation/index.md!g' {} \; find . -type f -name "*.md" -exec sed -i 's/new-cli/New-CLI/g' {} \; find . -type f -name "*.md" -exec sed -i 's/Command-Reference\.html//g' {} \; find . -type f -name "*.md" -exec sed -i 's/Command-Reference\.md//g' {} \; find . -type f -name "*.md" -exec sed -i 's/conf-file\.html/conf-file\.md/g' {} \; - find . -type f -name "*.md" -exec sed -i 's/nix-env\.md/nix-env/g' {} \; + find . -type f -name "*.md" -exec sed -i 's/nix-env\.md/nix-env\/index.md/g' {} \; + find . -type f -name "*.md" -exec sed -i 's/nix-store\.md/nix-store\/index.md/g' {} \; find . -type f -name "*.md" -exec sed -i 's/values\.html/values\.md/g' {} \; + find . -type f -name "*.md" -exec sed -i 's/distributed-builds\.html/distributed-builds\.md/g' {} \; # Final misc cleanups find . -type f -name "*.md" -exec sed -i 's/[\]//g' {} \;