summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2019-01-04 21:13:19 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2019-01-04 21:13:19 +0100
commit9618abe87c966250ecd7e0156a298cc07b35ba51 (patch)
treef5734612a231bab92e74364d914e52bef3676826 /doc
parent030f66400db0ce32f988045e5b35b27d75f2fe33 (diff)
parent1a7d28e31f3f66f5806b9b150b978aef9b5fbe7e (diff)
downloadnixpkgs-9618abe87c966250ecd7e0156a298cc07b35ba51.tar
nixpkgs-9618abe87c966250ecd7e0156a298cc07b35ba51.tar.gz
nixpkgs-9618abe87c966250ecd7e0156a298cc07b35ba51.tar.bz2
nixpkgs-9618abe87c966250ecd7e0156a298cc07b35ba51.tar.lz
nixpkgs-9618abe87c966250ecd7e0156a298cc07b35ba51.tar.xz
nixpkgs-9618abe87c966250ecd7e0156a298cc07b35ba51.tar.zst
nixpkgs-9618abe87c966250ecd7e0156a298cc07b35ba51.zip
Merge master into staging-next
Diffstat (limited to 'doc')
-rw-r--r--doc/default.nix5
-rw-r--r--doc/functions/library.xml9
-rw-r--r--doc/lib-function-docs.nix26
3 files changed, 38 insertions, 2 deletions
diff --git a/doc/default.nix b/doc/default.nix
index 98b4b92be52..7ceaec28af3 100644
--- a/doc/default.nix
+++ b/doc/default.nix
@@ -2,8 +2,8 @@
 let
   lib = pkgs.lib;
   locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
-in
-pkgs.stdenv.mkDerivation {
+  functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
+in pkgs.stdenv.mkDerivation {
   name = "nixpkgs-manual";
 
   buildInputs = with pkgs; [ pandoc libxml2 libxslt zip jing  xmlformat ];
@@ -32,6 +32,7 @@ pkgs.stdenv.mkDerivation {
   postPatch = ''
     rm -rf ./functions/library/locations.xml
     ln -s ${locationsXml} ./functions/library/locations.xml
+    ln -s ${functionDocs} ./functions/library/generated
     echo ${lib.version} > .version
   '';
 
diff --git a/doc/functions/library.xml b/doc/functions/library.xml
index 901423c52a1..b01de3c6e41 100644
--- a/doc/functions/library.xml
+++ b/doc/functions/library.xml
@@ -12,4 +12,13 @@
  <xi:include href="./library/asserts.xml" />
 
  <xi:include href="./library/attrsets.xml" />
+
+ <!-- These docs are generated via nixdoc. To add another generated
+      library function file to this list, the file
+      `lib-function-docs.nix` must also be updated. -->
+ <xi:include href="./library/generated/strings.xml" />
+ <xi:include href="./library/generated/trivial.xml" />
+ <xi:include href="./library/generated/lists.xml" />
+ <xi:include href="./library/generated/debug.xml" />
+ <xi:include href="./library/generated/options.xml" />
 </section>
diff --git a/doc/lib-function-docs.nix b/doc/lib-function-docs.nix
new file mode 100644
index 00000000000..421f848d25a
--- /dev/null
+++ b/doc/lib-function-docs.nix
@@ -0,0 +1,26 @@
+# Generates the documentation for library functons 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.
+
+{ pkgs ? import ./.. {}, locationsXml }:
+
+with pkgs; stdenv.mkDerivation {
+  name = "nixpkgs-lib-docs";
+  src = ./../lib;
+
+  buildInputs = [ nixdoc ];
+  installPhase = ''
+    function docgen {
+      nixdoc -c "$1" -d "$2" -f "../lib/$1.nix"  > "$out/$1.xml"
+    }
+
+    mkdir -p $out
+    ln -s ${locationsXml} $out/locations.xml
+
+    docgen strings 'String manipulation functions'
+    docgen trivial 'Miscellaneous functions'
+    docgen lists 'List manipulation functions'
+    docgen debug 'Debugging functions'
+    docgen options 'NixOS / nixpkgs option handling'
+  '';
+}