Added converter from new option description format to needed for docbook generation.

svn path=/nixpkgs/trunk/; revision=9626
This commit is contained in:
Michael Raskin 2007-11-11 09:27:52 +00:00
parent 7a9d92486f
commit 0ba29c56f8

View File

@ -230,5 +230,18 @@ rec {
else addDefaultOptionValues defValue {};
}
) (builtins.attrNames defs));
optionAttrSetToDocList = (l: attrs:
(if (getAttr ["_type"] "" attrs) == "option" then
[({
inherit (attrs) description;
}
//(if attrs ? example then {inherit(attrs) example;} else {} )
//(if attrs ? default then {inherit(attrs) default;} else {} )
//{name = l;}
)]
else (concatLists (map (s: (optionAttrSetToDocList
(l + (if l=="" then "" else ".") + s) (builtins.getAttr s attrs)))
(builtins.attrNames attrs)))));
}