diff --git a/docs/default.nix b/docs/default.nix index e83e24eb..194c74c6 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -108,7 +108,10 @@ lib.fix ( gfm-alerts-to-admonitions = pkgs.python3.pkgs.callPackage ./gfm-alerts-to-admonitions { }; - man-docs = pkgs.callPackage ./man { inherit options-json; }; + man-docs = pkgs.callPackage ./man { + inherit options-json; + inherit (self) lib-docs; + }; lib-docs = pkgs.callPackage ./lib { inherit nixvim lib; diff --git a/docs/user-guide/helpers.md b/docs/lib/index.md similarity index 100% rename from docs/user-guide/helpers.md rename to docs/lib/index.md diff --git a/docs/lib/pages.nix b/docs/lib/pages.nix index dba6ff08..7311c1ae 100644 --- a/docs/lib/pages.nix +++ b/docs/lib/pages.nix @@ -4,5 +4,9 @@ # If there is an issue parsing the file, the resulting markdown will not contain any function docs. { - # TODO + lib.pages = { + nixvim = { + markdown = ./index.md; + }; + }; } diff --git a/docs/man/default.nix b/docs/man/default.nix index c60743e1..452fbf03 100644 --- a/docs/man/default.nix +++ b/docs/man/default.nix @@ -1,6 +1,7 @@ { lib, options-json, + lib-docs, runCommand, installShellFiles, nixos-render-docs, @@ -23,7 +24,7 @@ let cat ${./nixvim-header-start.5} ${lib.concatMapStringsSep "\n" (file: "mkMDSection ${file}") [ - ../user-guide/helpers.md + "${lib-docs}/lib/index.md" ../user-guide/faq.md ../user-guide/config-examples.md ]} diff --git a/docs/mdbook/SUMMARY.md b/docs/mdbook/SUMMARY.md index ab132ab3..88d01d8d 100644 --- a/docs/mdbook/SUMMARY.md +++ b/docs/mdbook/SUMMARY.md @@ -5,7 +5,6 @@ # User guide - [Installation](./user-guide/install.md) -- [Helpers](./user-guide/helpers.md) - [FAQ](./user-guide/faq.md) - [Configuration examples](./user-guide/config-examples.md) - [Lazy Loading](./user-guide/lazy-loading.md) diff --git a/docs/mdbook/book.toml b/docs/mdbook/book.toml index 2e11c824..a74ba126 100644 --- a/docs/mdbook/book.toml +++ b/docs/mdbook/book.toml @@ -10,6 +10,11 @@ site-url = "@SITE_URL@" additional-js = ["theme/pagetoc.js"] additional-css = ["theme/pagetoc.css"] +# Redirect targets must be relative to their origin; +# absolute paths can break with different baseHrefs. +[output.html.redirect] +"/user-guide/helpers.html" = "../lib/index.html" # Since #3049 + [output.html.fold] enable = true level = 0 diff --git a/lib/modules.nix b/lib/modules.nix index 5bcba061..5d73b09e 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -27,7 +27,7 @@ in assert lib.assertMsg (extraSpecialArgs ? lib -> extraSpecialArgs.lib ? nixvim) '' Nixvim requires a lib that includes some custom extensions, however the `lib` from `specialArgs` does not have a `nixvim` attr. Remove `lib` from nixvim's `specialArgs` or ensure you apply nixvim's extensions to your `lib`. - See https://nix-community.github.io/nixvim/user-guide/helpers.html#using-a-custom-lib-with-nixvim''; + See https://nix-community.github.io/nixvim/lib/index.html#using-a-custom-lib-with-nixvim''; assert lib.assertMsg (system != null -> lib.isString system) '' When `system` is supplied to `evalNixvim`, it must be a string. To define a more complex system, please use nixvim's `nixpkgs.hostPlatform` option.'';