--- %YAML:1.0
test: Trailing Document Separator
todo: true
brief: >
You can separate YAML documents
with a string of three dashes.
yaml: |
- foo: 1
bar: 2
---
more: stuff
python: |
[
[ { 'foo': 1, 'bar': 2 } ],
{ 'more': 'stuff' }
]
ruby: |
[ { 'foo' => 1, 'bar' => 2 } ]
test: Leading Document Separator
You can explicitly give an opening
document separator to your YAML stream.
[ {'foo': 1, 'bar': 2}],
{'more': 'stuff'}
test: YAML Header
The opening separator can contain directives
to the YAML parser, such as the version
number.
foo: 1
php: |
array('foo' => 1, 'bar' => 2)
documents: 1
test: Red Herring Document Separator
Separators included in blocks or strings
are treated as blocks or strings, as the
document separator should have no indentation
preceding it.
foo: |
array('foo' => "---\n")
test: Multiple Document Separators in Block
This technique allows you to embed other YAML
documents within literal blocks.
foo: bar
yo: baz
bar: |
fooness
array(
'foo' => "---\nfoo: bar\n---\nyo: baz\n",
'bar' => "fooness\n"
)