git.iko.soy/typeable/nixpkgs
on master help sign in
Add Type information into manual and manpages, fixes #4600
commit79a51b0cf3e9fb27c098b15eada512aaf9edc7de authorDomen Kožar <domen@dev.si> dateSun 4 Jan 2015, 15:40 (12 years ago) parent7af2eee
3 files changed+11−1
lib/options.nix+1 nixos/doc/manual/default.nix+2−1 nixos/doc/manual/options-to-docbook.xsl+8
lib/options.nix+1
@@ -96,6 +96,7 @@ rec {
9696 declarations = filter (x: x != unknownModule) opt.declarations;
9797 internal = opt.internal or false;
9898 visible = opt.visible or true;
99+ type = opt.type.name or null;
99100 }
100101 // (if opt ? example then { example = scrubOptionValue opt.example; } else {})
101102 // (if opt ? default then { default = scrubOptionValue opt.default; } else {})
nixos/doc/manual/default.nix+2−1
@@ -20,7 +20,8 @@ let
2020 declarations = map (fn: stripPrefix fn) opt.declarations;
2121 }
2222 // optionalAttrs (opt ? example) { example = substFunction opt.example; }
23− // optionalAttrs (opt ? default) { default = substFunction opt.default; });
23+ // optionalAttrs (opt ? default) { default = substFunction opt.default; }
24+ // optionalAttrs (opt ? type) { type = substFunction opt.type; });
2425
2526 prefix = toString ../../..;
2627
nixos/doc/manual/options-to-docbook.xsl+8
@@ -34,6 +34,14 @@
3434 select="attr[@name = 'description']/string/@value" />
3535 </para>
3636
37+ <xsl:if test="attr[@name = 'type']">
38+ <para>
39+ <emphasis>Type:</emphasis>
40+ <xsl:text> </xsl:text>
41+ <xsl:apply-templates select="attr[@name = 'type']" mode="top" />
42+ </para>
43+ </xsl:if>
44+
3745 <xsl:if test="attr[@name = 'default']">
3846 <para>
3947 <emphasis>Default:</emphasis>