diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2019-11-24 17:25:07 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2019-11-24 17:25:07 +0000 |
commit | d0d5136cce5e0cbe2305c53090bd4bd886114746 (patch) | |
tree | 70092947536a3c65e215df9df20e571e34652f7a /doc/functions/generators.xml | |
parent | 9b090ccbca3f7dd26d91db06e96e8bf8282c37ca (diff) | |
parent | 195c263a812dec532656dcfd5d0360458cdc93fd (diff) |
Merge remote-tracking branch 'upstream/master' into wrapper-pname-support
Diffstat (limited to 'doc/functions/generators.xml')
-rw-r--r-- | doc/functions/generators.xml | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/doc/functions/generators.xml b/doc/functions/generators.xml index e860b10e8979f..9ce1f85eb1731 100644 --- a/doc/functions/generators.xml +++ b/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> |