-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205643 from ncfavier/doc-lib
doc/lib-functions: remove warnings, add `versions`, `cli`
- Loading branch information
Showing
5 changed files
with
41 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
# Generates the documentation for library functions via nixdoc. To add | ||
# another library function file to this list, the include list in the | ||
# file `doc/functions/library.xml` must also be updated. | ||
# Generates the documentation for library functions via nixdoc. | ||
|
||
{ pkgs ? import ./.. {}, locationsXml }: | ||
{ pkgs, locationsXml, libsets }: | ||
|
||
with pkgs; stdenv.mkDerivation { | ||
name = "nixpkgs-lib-docs"; | ||
src = ./../../lib; | ||
src = ../../lib; | ||
|
||
buildInputs = [ nixdoc ]; | ||
installPhase = '' | ||
function docgen { | ||
nixdoc -c "$1" -d "$2" -f "../lib/$1.nix" > "$out/$1.xml" | ||
# TODO: wrap lib.$1 in <literal>, make nixdoc not escape it | ||
nixdoc -c "$1" -d "lib.$1: $2" -f "$1.nix" > "$out/$1.xml" | ||
echo "<xi:include href='$1.xml' />" >> "$out/index.xml" | ||
} | ||
mkdir -p $out | ||
ln -s ${locationsXml} $out/locations.xml | ||
mkdir -p "$out" | ||
cat > "$out/index.xml" << 'EOF' | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<root xmlns:xi="http://www.w3.org/2001/XInclude"> | ||
EOF | ||
${lib.concatMapStrings ({ name, description }: '' | ||
docgen ${name} ${lib.escapeShellArg description} | ||
'') libsets} | ||
docgen asserts 'Assert functions' | ||
docgen attrsets 'Attribute-set functions' | ||
docgen strings 'String manipulation functions' | ||
docgen trivial 'Miscellaneous functions' | ||
docgen lists 'List manipulation functions' | ||
docgen debug 'Debugging functions' | ||
docgen options 'NixOS / nixpkgs option handling' | ||
docgen filesystem 'Filesystem functions' | ||
docgen sources 'Source filtering functions' | ||
echo "</root>" >> "$out/index.xml" | ||
ln -s ${locationsXml} $out/locations.xml | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters