YtsDocumentSeparator.yml (1531B)
1 --- %YAML:1.0 2 test: Trailing Document Separator 3 todo: true 4 brief: > 5 You can separate YAML documents 6 with a string of three dashes. 7 yaml: | 8 - foo: 1 9 bar: 2 10 --- 11 more: stuff 12 python: | 13 [ 14 [ { 'foo': 1, 'bar': 2 } ], 15 { 'more': 'stuff' } 16 ] 17 ruby: | 18 [ { 'foo' => 1, 'bar' => 2 } ] 19 20 --- 21 test: Leading Document Separator 22 todo: true 23 brief: > 24 You can explicitly give an opening 25 document separator to your YAML stream. 26 yaml: | 27 --- 28 - foo: 1 29 bar: 2 30 --- 31 more: stuff 32 python: | 33 [ 34 [ {'foo': 1, 'bar': 2}], 35 {'more': 'stuff'} 36 ] 37 ruby: | 38 [ { 'foo' => 1, 'bar' => 2 } ] 39 40 --- 41 test: YAML Header 42 todo: true 43 brief: > 44 The opening separator can contain directives 45 to the YAML parser, such as the version 46 number. 47 yaml: | 48 --- %YAML:1.0 49 foo: 1 50 bar: 2 51 php: | 52 array('foo' => 1, 'bar' => 2) 53 documents: 1 54 55 --- 56 test: Red Herring Document Separator 57 brief: > 58 Separators included in blocks or strings 59 are treated as blocks or strings, as the 60 document separator should have no indentation 61 preceding it. 62 yaml: | 63 foo: | 64 --- 65 php: | 66 array('foo' => "---\n") 67 68 --- 69 test: Multiple Document Separators in Block 70 brief: > 71 This technique allows you to embed other YAML 72 documents within literal blocks. 73 yaml: | 74 foo: | 75 --- 76 foo: bar 77 --- 78 yo: baz 79 bar: | 80 fooness 81 php: | 82 array( 83 'foo' => "---\nfoo: bar\n---\nyo: baz\n", 84 'bar' => "fooness\n" 85 )