* Do not silently ignore broken "example" and "default" attributes
when generating the documentation. If they're broken, they should be fixed. svn path=/nixpkgs/trunk/; revision=21738
This commit is contained in:
parent
55a322022c
commit
da7e1fbea3
@ -251,12 +251,6 @@ rec {
|
|||||||
# the set generated with filterOptionSets.
|
# the set generated with filterOptionSets.
|
||||||
optionAttrSetToDocList = ignore: newOptionAttrSetToDocList;
|
optionAttrSetToDocList = ignore: newOptionAttrSetToDocList;
|
||||||
newOptionAttrSetToDocList = attrs:
|
newOptionAttrSetToDocList = attrs:
|
||||||
let tryEval = v:
|
|
||||||
let res = builtins.tryEval v; in
|
|
||||||
if builtins ? tryEval then
|
|
||||||
if res.success then res.value else "<error>"
|
|
||||||
else v;
|
|
||||||
in
|
|
||||||
let options = collect isOption attrs; in
|
let options = collect isOption attrs; in
|
||||||
fold (opt: rest:
|
fold (opt: rest:
|
||||||
let
|
let
|
||||||
@ -268,8 +262,8 @@ rec {
|
|||||||
declarations = map (x: toString x.source) opt.declarations;
|
declarations = map (x: toString x.source) opt.declarations;
|
||||||
definitions = map (x: toString x.source) opt.definitions;
|
definitions = map (x: toString x.source) opt.definitions;
|
||||||
}
|
}
|
||||||
// optionalAttrs (opt ? example) { example = tryEval opt.example; }
|
// optionalAttrs (opt ? example) { example = opt.example; }
|
||||||
// optionalAttrs (opt ? default) { default = tryEval opt.default; };
|
// optionalAttrs (opt ? default) { default = opt.default; };
|
||||||
|
|
||||||
subOptions =
|
subOptions =
|
||||||
if opt ? options then
|
if opt ? options then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user