doc: Add automatic generation of library function documentation

Modifies the build process of the manual to invoke nixdoc
automatically to generate XML files with function documentation.

Currently documentation is present for five of the files in `lib/`.

To add another file to the generated docs, both
`doc/functions/library.xml` and `doc/lib-function-docs.nix` must be
updated.
This commit is contained in:
Vincent Ambo
2019-01-04 11:28:27 +01:00
committed by Frederik Rietdijk
parent eab0c3258f
commit 0c99dac497
3 changed files with 38 additions and 2 deletions
+3 -2
View File
@@ -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
'';