Blame | Last modification | View Log | Download
--- %YAML:1.0test: Simple Sequencebrief: |You can specify a list in YAML by placing eachmember of the list on a new line with an openingdash. These lists are called sequences.yaml: |- apple- banana- carrotphp: |array('apple', 'banana', 'carrot')---test: Sequence With Item Being Null In The Middlebrief: |You can specify a list in YAML by placing eachmember of the list on a new line with an openingdash. These lists are called sequences.yaml: |- apple-- carrotphp: |array('apple', null, 'carrot')---test: Sequence With Last Item Being Nullbrief: |You can specify a list in YAML by placing eachmember of the list on a new line with an openingdash. These lists are called sequences.yaml: |- apple- banana-php: |array('apple', 'banana', null)---test: Nested Sequencesbrief: |You can include a sequence within anothersequence by giving the sequence an emptydash, followed by an indented list.yaml: |-- foo- bar- bazphp: |array(array('foo', 'bar', 'baz'))---test: Mixed Sequencesbrief: |Sequences can contain any YAML data,including strings and other sequences.yaml: |- apple-- foo- bar- x123- banana- carrotphp: |array('apple', array('foo', 'bar', 'x123'), 'banana', 'carrot')---test: Deeply Nested Sequencesbrief: |Sequences can be nested even deeper, with eachlevel of indentation representing a level ofdepth.yaml: |--- uno- dosphp: |array(array(array('uno', 'dos')))---test: Simple Mappingbrief: |You can add a keyed list (also known as a dictionary orhash) to your document by placing each member of thelist on a new line, with a colon separating the keyfrom its value. In YAML, this type of list is calleda mapping.yaml: |foo: whateverbar: stuffphp: |array('foo' => 'whatever', 'bar' => 'stuff')---test: Sequence in a Mappingbrief: |A value in a mapping can be a sequence.yaml: |foo: whateverbar:- uno- dosphp: |array('foo' => 'whatever', 'bar' => array('uno', 'dos'))---test: Nested Mappingsbrief: |A value in a mapping can be another mapping.yaml: |foo: whateverbar:fruit: applename: stevesport: baseballphp: |array('foo' => 'whatever','bar' => array('fruit' => 'apple','name' => 'steve','sport' => 'baseball'))---test: Mixed Mappingbrief: |A mapping can contain any assortmentof mappings and sequences as values.yaml: |foo: whateverbar:-fruit: applename: stevesport: baseball- more-python: rocksperl: papersruby: scissorsesphp: |array('foo' => 'whatever','bar' => array(array('fruit' => 'apple','name' => 'steve','sport' => 'baseball'),'more',array('python' => 'rocks','perl' => 'papers','ruby' => 'scissorses')))---test: Mapping-in-Sequence Shortcuttodo: truebrief: |If you are adding a mapping to a sequence, youcan place the mapping on the same line as thedash as a shortcut.yaml: |- work on YAML.py:- work on Storephp: |array(array('work on YAML.py' => array('work on Store')))---test: Sequence-in-Mapping Shortcuttodo: truebrief: |The dash in a sequence counts as indentation, soyou can add a sequence inside of a mapping withoutneeding spaces as indentation.yaml: |allow:- 'localhost'- '%.sourceforge.net'- '%.freepan.org'php: |array('allow' => array('localhost', '%.sourceforge.net', '%.freepan.org'))---todo: truetest: Merge keybrief: |A merge key ('<<') can be used in a mapping to insert other mappings. Ifthe value associated with the merge key is a mapping, each of its key/valuepairs is inserted into the current mapping.yaml: |mapping:name: Joejob: Accountant<<:age: 38php: |array('mapping' =>array('name' => 'Joe','job' => 'Accountant','age' => 38))