diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-09-20 19:56:04 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-09-28 14:40:49 +0000 |
commit | 36bedbe5c162bab9e7ef702f353ae399fdfd0518 (patch) | |
tree | fb2926eee09fe0714683074758276739e9e5cda9 /nixpkgs/doc/functions/generators.xml | |
parent | 47852a9ef0e62a2d565f9ec0fba2a3ae77c44221 (diff) | |
parent | 262b328b0bad0c4b97ed495679208e4a2eb87704 (diff) | |
download | nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar.gz nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar.bz2 nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar.lz nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar.xz nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar.zst nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.zip |
Merge commit '262b328b0bad0c4b97ed495679208e4a2eb87704'
Diffstat (limited to 'nixpkgs/doc/functions/generators.xml')
-rw-r--r-- | nixpkgs/doc/functions/generators.xml | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/nixpkgs/doc/functions/generators.xml b/nixpkgs/doc/functions/generators.xml index e860b10e8979..9ce1f85eb173 100644 --- a/nixpkgs/doc/functions/generators.xml +++ b/nixpkgs/doc/functions/generators.xml @@ -5,28 +5,15 @@ <title>Generators</title> <para> - Generators are functions that create file formats from nix data structures, - e. g. for configuration files. There are generators available for: - <literal>INI</literal>, <literal>JSON</literal> and <literal>YAML</literal> + Generators are functions that create file formats from nix data structures, e. g. for configuration files. There are generators available for: <literal>INI</literal>, <literal>JSON</literal> and <literal>YAML</literal> </para> <para> - All generators follow a similar call interface: <code>generatorName - configFunctions data</code>, where <literal>configFunctions</literal> is an - attrset of user-defined functions that format nested parts of the content. - They each have common defaults, so often they do not need to be set manually. - An example is <code>mkSectionName ? (name: libStr.escape [ "[" "]" ] - name)</code> from the <literal>INI</literal> generator. It receives the name - of a section and sanitizes it. The default <literal>mkSectionName</literal> - escapes <literal>[</literal> and <literal>]</literal> with a backslash. + All generators follow a similar call interface: <code>generatorName configFunctions data</code>, where <literal>configFunctions</literal> is an attrset of user-defined functions that format nested parts of the content. They each have common defaults, so often they do not need to be set manually. An example is <code>mkSectionName ? (name: libStr.escape [ "[" "]" ] name)</code> from the <literal>INI</literal> generator. It receives the name of a section and sanitizes it. The default <literal>mkSectionName</literal> escapes <literal>[</literal> and <literal>]</literal> with a backslash. </para> <para> - Generators can be fine-tuned to produce exactly the file format required by - your application/service. One example is an INI-file format which uses - <literal>: </literal> as separator, the strings - <literal>"yes"</literal>/<literal>"no"</literal> as boolean values and - requires all string values to be quoted: + Generators can be fine-tuned to produce exactly the file format required by your application/service. One example is an INI-file format which uses <literal>: </literal> as separator, the strings <literal>"yes"</literal>/<literal>"no"</literal> as boolean values and requires all string values to be quoted: </para> <programlisting> @@ -77,13 +64,11 @@ merge:"diff3" <note> <para> - Nix store paths can be converted to strings by enclosing a derivation - attribute like so: <code>"${drv}"</code>. + Nix store paths can be converted to strings by enclosing a derivation attribute like so: <code>"${drv}"</code>. </para> </note> <para> - Detailed documentation for each generator can be found in - <literal>lib/generators.nix</literal>. + Detailed documentation for each generator can be found in <literal>lib/generators.nix</literal>. </para> </section> |