lib-doc -> lib-docs

This commit is contained in:
Pyrox 2024-06-30 17:57:03 -04:00
parent 111239c73b
commit dffb62de95
Signed by untrusted user: pyrox
GPG key ID: 8CDF3F7CAA53A0F5

View file

@ -1,8 +1,13 @@
# Generates the documentation for library functions via nixdoc. # Generates the documentation for library functions via nixdoc.
{ pkgs, inputs, ... }: {
pkgs,
inputs,
lib,
...
}:
let let
inherit (pkgs) stdenv lib nixdoc; inherit (pkgs) stdenv nixdoc;
in in
stdenv.mkDerivation { stdenv.mkDerivation {
@ -17,9 +22,9 @@ stdenv.mkDerivation {
description=$3 description=$3
# TODO: wrap lib.$name in <literal>, make nixdoc not escape it # TODO: wrap lib.$name in <literal>, make nixdoc not escape it
if [[ -e "../lib/$baseName.nix" ]]; then if [[ -e "../lib/$baseName.nix" ]]; then
nixdoc -c "$name" -d "lib.$name: $description" -l ${pkgs.doc-locations-json} -f "$baseName.nix" > "$out/$name.md" nixdoc -c "$name" -d "lib.$name: $description" -l ${pkgs.amg.doc-locations-json} -f "$baseName.nix" > "$out/$name.md"
else else
nixdoc -c "$name" -d "lib.$name: $description" -l ${pkgs.doc-locations-json} -f "$baseName/default.nix" > "$out/$name.md" nixdoc -c "$name" -d "lib.$name: $description" -l ${pkgs.amg.doc-locations-json} -f "$baseName/default.nix" > "$out/$name.md"
fi fi
} }
@ -34,6 +39,6 @@ stdenv.mkDerivation {
'' ''
docgen ${name} ${baseName} ${lib.escapeShellArg description} docgen ${name} ${baseName} ${lib.escapeShellArg description}
'' ''
) pkgs.libsets} ) lib.amg.libsets}
''; '';
} }