<page xmlns="http://projectmallard.org/1.0/" type="guide" id="variables">
<info>
    <link type="guide" xref="index#recipes"/>
</info>

<title>Variables</title>

<p>
A <em>variable</em> allows you to specify a named value for use in a <link xref="recipe-files">recipe</link>.
</p>
<p>
The syntax for a variable is:
</p>
<code>
<em>name</em> = <em>value</em>
</code>
<p>
Where <em>name</em> is a continuous set of printable characters and <em>value</em> can be anything.
The variable statement is normally terminated by a newline, if a '\' is the last printable character on a line the value continues to the next line.
</p>
<p>
Variables are grouped using the '.' character.
</p>
<example>
<p>
The following are all valid variables:
</p>
<code>
name = value
multiple-line = Line 1\
                Line 2
section.subsection = value                
</code>
</example>
<p>
Variables can also be described in groups using the following syntax:
</p>
<code>
<em>groupname</em> {
  <em>childname1</em> = <em>value1</em>
  <em>...</em>
}
</code>
<p>
Each variable in the group has the name <em>groupname</em>.<em>childname</em>.
</p>
<example>
<p>
The following variable group:
</p>
<code>
project {
  name = example
  version = 0.1
}
</code>
<p>
is the equivalent of:
</p>
<code>
project.name = example
project.version = 0.1
</code>
</example>
</page>
