diff options
| author | Robert Hensing <robert@roberthensing.nl> | 2022-06-15 00:44:09 +0200 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2022-06-22 13:53:56 +0000 |
| commit | 795336437d3dd2c5756e936ee980a0ae68a279ac (patch) | |
| tree | a74c58b31f92d5f00e008ad51fe6ae0cb5c16fd0 | |
| parent | make-options-doc: Support Nix-provided declaration links (diff) | |
| download | nixpkgs-origin/backport-174460-to-release-22.05.tar.gz | |
doc: Fix config options reference file linksorigin/backport-174460-to-release-22.05
(cherry picked from commit 11b33fcdccf8d40738ba28f9e9eb7133559d9aa8)
| -rw-r--r-- | doc/doc-support/default.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/doc-support/default.nix b/doc/doc-support/default.nix index 7c00195ab390..429c7a5fbe80 100644 --- a/doc/doc-support/default.nix +++ b/doc/doc-support/default.nix @@ -1,5 +1,8 @@ { pkgs ? (import ../.. {}), nixpkgs ? { }}: let + inherit (pkgs) lib; + inherit (lib) hasPrefix removePrefix; + locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; }; functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; }; version = pkgs.lib.version; @@ -29,6 +32,18 @@ let optionsDoc = pkgs.nixosOptionsDoc { inherit (pkgs.lib.evalModules { modules = [ ../../pkgs/top-level/config.nix ]; }) options; documentType = "none"; + transformOptions = opt: + opt // { + declarations = + map + (decl: + if hasPrefix (toString ../..) (toString decl) + then + let subpath = removePrefix "/" (removePrefix (toString ../..) (toString decl)); + in { url = "https://github.com/NixOS/nixpkgs/blob/master/${subpath}"; name = subpath; } + else decl) + opt.declarations; + }; }; in pkgs.runCommand "doc-support" {} |
