docs: user-guide/helpers.mdlib/index.md

Move the user-guide to the new lib reference docs.

Added a MDBook redirect entry.

Updated man docs.
This commit is contained in:
Matt Sturgeon 2025-05-15 14:54:58 +01:00
parent 1c6dd6579a
commit 0c7e2aa96b
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
7 changed files with 17 additions and 5 deletions

View file

@ -108,7 +108,10 @@ lib.fix (
gfm-alerts-to-admonitions = pkgs.python3.pkgs.callPackage ./gfm-alerts-to-admonitions { }; 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 { lib-docs = pkgs.callPackage ./lib {
inherit nixvim lib; inherit nixvim lib;

View file

@ -4,5 +4,9 @@
# If there is an issue parsing the file, the resulting markdown will not contain any function docs. # If there is an issue parsing the file, the resulting markdown will not contain any function docs.
{ {
# TODO lib.pages = {
nixvim = {
markdown = ./index.md;
};
};
} }

View file

@ -1,6 +1,7 @@
{ {
lib, lib,
options-json, options-json,
lib-docs,
runCommand, runCommand,
installShellFiles, installShellFiles,
nixos-render-docs, nixos-render-docs,
@ -23,7 +24,7 @@ let
cat ${./nixvim-header-start.5} cat ${./nixvim-header-start.5}
${lib.concatMapStringsSep "\n" (file: "mkMDSection ${file}") [ ${lib.concatMapStringsSep "\n" (file: "mkMDSection ${file}") [
../user-guide/helpers.md "${lib-docs}/lib/index.md"
../user-guide/faq.md ../user-guide/faq.md
../user-guide/config-examples.md ../user-guide/config-examples.md
]} ]}

View file

@ -5,7 +5,6 @@
# User guide # User guide
- [Installation](./user-guide/install.md) - [Installation](./user-guide/install.md)
- [Helpers](./user-guide/helpers.md)
- [FAQ](./user-guide/faq.md) - [FAQ](./user-guide/faq.md)
- [Configuration examples](./user-guide/config-examples.md) - [Configuration examples](./user-guide/config-examples.md)
- [Lazy Loading](./user-guide/lazy-loading.md) - [Lazy Loading](./user-guide/lazy-loading.md)

View file

@ -10,6 +10,11 @@ site-url = "@SITE_URL@"
additional-js = ["theme/pagetoc.js"] additional-js = ["theme/pagetoc.js"]
additional-css = ["theme/pagetoc.css"] 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] [output.html.fold]
enable = true enable = true
level = 0 level = 0

View file

@ -27,7 +27,7 @@ in
assert lib.assertMsg (extraSpecialArgs ? lib -> extraSpecialArgs.lib ? nixvim) '' 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. 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`. 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) '' assert lib.assertMsg (system != null -> lib.isString system) ''
When `system` is supplied to `evalNixvim`, it must be a string. When `system` is supplied to `evalNixvim`, it must be a string.
To define a more complex system, please use nixvim's `nixpkgs.hostPlatform` option.''; To define a more complex system, please use nixvim's `nixpkgs.hostPlatform` option.'';