YAML Cheat Sheet
YAML is a simple but robust data serialization language. It achieves high flexibility with just
two data structures: sequences (a list) and mappings (key and value pairs).
Sequence (lists) Mapping (key value pairs)
---
- Linux
- BSD
- Illumos
---
Kernel: Linux
CPU: AMD
RAM: 16 GB
These structures can be combined and embedded.
Sequence of mappings (list of pairs) Mapping sequences (key with many values)
---
-
CPU: AMD
RAM: ‘16 GB’
-
CPU: Intel
RAM: ‘16 GB’
---
Linux:
- Fedora
- Slackware
FreeBSD:
- FreeBSD
- NetBSD
Sequence of sequences (a list of lists) Mapping of mapping (many keys and values)
---
- [Linux, FreeBSD, Illumos]
- [YAML, XML, JSON]
---
Desktop:
CPU: AMD
RAM: ‘32 GB’
Seth Kenlon CC BY-SA 4.0 Opensource.com