YAML Syntax Rules & FeaturesBlock scalars, key-value mappings, sequences, and document delimiters.
Key followed by colon and space, hierarchy indicated strictly by whitespace indentation.
name: softoys
List items prefixed with hyphen and space at consistent indent levels.
- item1
- item2
Three hyphens delimit separate YAML documents in a single stream/file.
---
doc1
---
doc2
Literal block scalar preserving internal newlines and whitespace formatting.
text: |
line 1
line 2
Folded block scalar replacing single newlines with spaces for long paragraphs.
text: >
long paragraph
&anchor marks a node for reuse; *alias references the previously anchored node.
&default
port: 80
*default