diff options
author | Domen Kožar <domen@dev.si> | 2015-01-04 15:40:59 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2015-01-04 15:41:32 +0100 |
commit | 79a51b0cf3e9fb27c098b15eada512aaf9edc7de (patch) | |
tree | e19db5d40ff8019d926c1c440d193daacda0f43b | |
parent | 7af2eee47202965d53aa957cab4fcc32cf809cd1 (diff) |
Add Type information into manual and manpages, fixes #4600
-rw-r--r-- | lib/options.nix | 1 | ||||
-rw-r--r-- | nixos/doc/manual/default.nix | 3 | ||||
-rw-r--r-- | nixos/doc/manual/options-to-docbook.xsl | 8 |
3 files changed, 11 insertions, 1 deletions
diff --git a/lib/options.nix b/lib/options.nix index 939f9948ceef..eed43daaeccf 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -96,6 +96,7 @@ rec { declarations = filter (x: x != unknownModule) opt.declarations; internal = opt.internal or false; visible = opt.visible or true; + type = opt.type.name or null; } // (if opt ? example then { example = scrubOptionValue opt.example; } else {}) // (if opt ? default then { default = scrubOptionValue opt.default; } else {}) diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index b0a755c6a6fc..fdfeb5ca07c1 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -20,7 +20,8 @@ let declarations = map (fn: stripPrefix fn) opt.declarations; } // optionalAttrs (opt ? example) { example = substFunction opt.example; } - // optionalAttrs (opt ? default) { default = substFunction opt.default; }); + // optionalAttrs (opt ? default) { default = substFunction opt.default; } + // optionalAttrs (opt ? type) { type = substFunction opt.type; }); prefix = toString ../../..; diff --git a/nixos/doc/manual/options-to-docbook.xsl b/nixos/doc/manual/options-to-docbook.xsl index e81a1dc356e1..af9eb0e48fb0 100644 --- a/nixos/doc/manual/options-to-docbook.xsl +++ b/nixos/doc/manual/options-to-docbook.xsl @@ -34,6 +34,14 @@ select="attr[@name = 'description']/string/@value" /> </para> + <xsl:if test="attr[@name = 'type']"> + <para> + <emphasis>Type:</emphasis> + <xsl:text> </xsl:text> + <xsl:apply-templates select="attr[@name = 'type']" mode="top" /> + </para> + </xsl:if> + <xsl:if test="attr[@name = 'default']"> <para> <emphasis>Default:</emphasis> |