pdoc
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
|
||||
loupe
|
||||
gnome-clocks
|
||||
shotwell # image editor
|
||||
|
||||
desktop-file-utils # update-desktop-database
|
||||
];
|
||||
|
||||
@@ -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 ''
|
||||
|
||||
Reference in New Issue
Block a user