From d7b4b63f4df8a03e19dae6e6754faa9ea082a18c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 5 Sep 2011 10:14:24 +0000 Subject: [PATCH] * Allow literal examples to be included in the manual. svn path=/nixpkgs/trunk/; revision=29024 --- pkgs/lib/options.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/lib/options.nix b/pkgs/lib/options.nix index d742544bef2..cd60b8f3b88 100644 --- a/pkgs/lib/options.nix +++ b/pkgs/lib/options.nix @@ -287,5 +287,12 @@ rec { else if isAttrs x then mapAttrs (n: v: scrubOptionValue v) (removeAttrs x ["_args"]) else x; - + + /* For use in the ‘example’ option attribute. It causes the given + text to be included verbatim in documentation. This is necessary + for example values that are not simple values, e.g., + functions. */ + literalExample = text: { _type = "literalExample"; inherit text; }; + + }