about summary refs log tree commit diff
path: root/doc/doc-support
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-07-08 18:43:36 +0200
committerRobert Hensing <robert@roberthensing.nl>2023-07-08 18:46:08 +0200
commitaa1beb0ab589b017a80927282d3ab60553071f71 (patch)
tree6e13b0aa60eac6bf99ca7c4991f137ffc10130e4 /doc/doc-support
parente08fab0406465bc1ba9f4d2895159c89e952ad71 (diff)
doc: Render lib.fixedPoints
Diffstat (limited to 'doc/doc-support')
-rw-r--r--doc/doc-support/lib-function-docs.nix17
1 files changed, 10 insertions, 7 deletions
diff --git a/doc/doc-support/lib-function-docs.nix b/doc/doc-support/lib-function-docs.nix
index 018b0bd5e9453..8592fafbbd15d 100644
--- a/doc/doc-support/lib-function-docs.nix
+++ b/doc/doc-support/lib-function-docs.nix
@@ -14,13 +14,16 @@ stdenv.mkDerivation {
   buildInputs = [ nixdoc ];
   installPhase = ''
     function docgen {
-      # TODO: wrap lib.$1 in <literal>, make nixdoc not escape it
-      if [[ -e "../lib/$1.nix" ]]; then
-        nixdoc -c "$1" -d "lib.$1: $2" -l ${locationsJSON} -f "$1.nix" > "$out/$1.md"
+      name=$1
+      baseName=$2
+      description=$3
+      # TODO: wrap lib.$name in <literal>, make nixdoc not escape it
+      if [[ -e "../lib/$baseName.nix" ]]; then
+        nixdoc -c "$name" -d "lib.$name: $description" -l ${locationsJSON} -f "$baseName.nix" > "$out/$name.md"
       else
-        nixdoc -c "$1" -d "lib.$1: $2" -l ${locationsJSON} -f "$1/default.nix" > "$out/$1.md"
+        nixdoc -c "$name" -d "lib.$name: $description" -l ${locationsJSON} -f "$baseName/default.nix" > "$out/$name.md"
       fi
-      echo "$out/$1.md" >> "$out/index.md"
+      echo "$out/$name.md" >> "$out/index.md"
     }
 
     mkdir -p "$out"
@@ -29,8 +32,8 @@ stdenv.mkDerivation {
     ```{=include=} sections
     EOF
 
-    ${lib.concatMapStrings ({ name, description }: ''
-      docgen ${name} ${lib.escapeShellArg description}
+    ${lib.concatMapStrings ({ name, baseName ? name, description }: ''
+      docgen ${name} ${baseName} ${lib.escapeShellArg description}
     '') libsets}
 
     echo '```' >> "$out/index.md"