Skip to content

Commit

Permalink
lib: Allow doc rendering for lib/<name>/default.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil committed Dec 23, 2022
1 parent b3792b4 commit 8496683
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doc/doc-support/lib-function-docs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ with pkgs; stdenv.mkDerivation {
installPhase = ''
function docgen {
# TODO: wrap lib.$1 in <literal>, make nixdoc not escape it
nixdoc -c "$1" -d "lib.$1: $2" -f "$1.nix" > "$out/$1.xml"
if [[ -e "../lib/$1.nix" ]]; then
nixdoc -c "$1" -d "lib.$1: $2" -f "$1.nix" > "$out/$1.xml"
else
nixdoc -c "$1" -d "lib.$1: $2" -f "$1/default.nix" > "$out/$1.xml"
fi
echo "<xi:include href='$1.xml' />" >> "$out/index.xml"
}
Expand Down

0 comments on commit 8496683

Please sign in to comment.