4 You can specify a list in YAML by placing each
5 member of the list on a new line with an opening
6 dash. These lists are called sequences.
12 array('apple', 'banana', 'carrot')
14 test: Sequence With Item Being Null In The Middle
16 You can specify a list in YAML by placing each
17 member of the list on a new line with an opening
18 dash. These lists are called sequences.
24 array('apple', null, 'carrot')
26 test: Sequence With Last Item Being Null
28 You can specify a list in YAML by placing each
29 member of the list on a new line with an opening
30 dash. These lists are called sequences.
36 array('apple', 'banana', null)
38 test: Nested Sequences
40 You can include a sequence within another
41 sequence by giving the sequence an empty
42 dash, followed by an indented list.
49 array(array('foo', 'bar', 'baz'))
53 Sequences can contain any YAML data,
54 including strings and other sequences.
64 array('apple', array('foo', 'bar', 'x123'), 'banana', 'carrot')
66 test: Deeply Nested Sequences
68 Sequences can be nested even deeper, with each
69 level of indentation representing a level of
77 array(array(array('uno', 'dos')))
81 You can add a keyed list (also known as a dictionary or
82 hash) to your document by placing each member of the
83 list on a new line, with a colon separating the key
84 from its value. In YAML, this type of list is called
90 array('foo' => 'whatever', 'bar' => 'stuff')
92 test: Sequence in a Mapping
94 A value in a mapping can be a sequence.
101 array('foo' => 'whatever', 'bar' => array('uno', 'dos'))
103 test: Nested Mappings
105 A value in a mapping can be another mapping.
118 'sport' => 'baseball'
124 A mapping can contain any assortment
125 of mappings and sequences as values.
145 'sport' => 'baseball'
151 'ruby' => 'scissorses'
156 test: Mapping-in-Sequence Shortcut
159 If you are adding a mapping to a sequence, you
160 can place the mapping on the same line as the
166 array(array('work on YAML.py' => array('work on Store')))
168 test: Sequence-in-Mapping Shortcut
171 The dash in a sequence counts as indentation, so
172 you can add a sequence inside of a mapping without
173 needing spaces as indentation.
177 - '%.sourceforge.net'
180 array('allow' => array('localhost', '%.sourceforge.net', '%.freepan.org'))
185 A merge key ('<<') can be used in a mapping to insert other mappings. If
186 the value associated with the merge key is a mapping, each of its key/value
187 pairs is inserted into the current mapping.
199 'job' => 'Accountant',