This commit is contained in:
2025-03-16 17:33:50 +01:00
parent 4c31b1b055
commit a4e4ebf40f
2 changed files with 17 additions and 5 deletions

View File

@@ -44,6 +44,7 @@
loupe
gnome-clocks
shotwell # image editor
desktop-file-utils # update-desktop-database
];

View File

@@ -177,10 +177,12 @@ let
then "https://docs.python.org/3/library/${toLiteral pkg}.html"
else pkgs.python3Packages.${toName pkg}.meta.homepage or "-";
doc = pkgs.runCommand "pdoc${if use-pdoc3 then "3" else ""}-${toName pkg}-docs" {
nativeBuildInputs = (if use-pdoc3
then [pkgs.python3Packages.pdoc3]
else [pkgs.python3Packages.pdoc])
++ lib.optional (!isBuiltin) (builtins.getAttr (toName pkg) pkgs.python3Packages);
nativeBuildInputs = [
pkgs.jq
(if use-pdoc3
then pkgs.python3Packages.pdoc3
else pkgs.python3Packages.pdoc)
] ++ lib.optional (!isBuiltin) pkgs.python3Packages.${toName pkg};
NAME = toName pkg;
LITERAL = toLiteral pkg;
# TODO: license
@@ -212,7 +214,16 @@ let
else
write "<td>-"
fi
write "<td>${lib.escapeXML description}"
if test "${description}" = "builtin"; then
write "<td>$(
python -c '
import '"$LITERAL"' as x;
print(getattr(x, "__doc__", "builtin").split("\n", 1)[0])
' | jq -Rr @html
)"
else
write "<td>${lib.escapeXML description}"
fi
${if homepage == "-" then ''
write "<td>n/a"
'' else ''