summary refs log tree commit diff
path: root/pkgs/lib/options.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2011-09-05 10:14:24 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2011-09-05 10:14:24 +0000
commitd7b4b63f4df8a03e19dae6e6754faa9ea082a18c (patch)
treecb22aa9d6464d7d395f39672ebb9772cfb4086ac /pkgs/lib/options.nix
parent1e6eeb9ad7750336dfcd1bdc47ef02c5ebd148c5 (diff)
downloadnixpkgs-d7b4b63f4df8a03e19dae6e6754faa9ea082a18c.tar
nixpkgs-d7b4b63f4df8a03e19dae6e6754faa9ea082a18c.tar.gz
nixpkgs-d7b4b63f4df8a03e19dae6e6754faa9ea082a18c.tar.bz2
nixpkgs-d7b4b63f4df8a03e19dae6e6754faa9ea082a18c.tar.lz
nixpkgs-d7b4b63f4df8a03e19dae6e6754faa9ea082a18c.tar.xz
nixpkgs-d7b4b63f4df8a03e19dae6e6754faa9ea082a18c.tar.zst
nixpkgs-d7b4b63f4df8a03e19dae6e6754faa9ea082a18c.zip
* Allow literal examples to be included in the manual.
svn path=/nixpkgs/trunk/; revision=29024
Diffstat (limited to 'pkgs/lib/options.nix')
-rw-r--r--pkgs/lib/options.nix9
1 files changed, 8 insertions, 1 deletions
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; };
+
+
 }