Yaml
[toc]
Remember to use two
spaces
nottab
.
- Scalars (strings / numbers / boolean)
- Sequences (arrays / lists)
- Mappings (hashes / dictionaries)
Scalars don’t need quotes unless their value embeds elements that can be confused with yaml syntax. Quotes can be single or double quotes.
integer: 25
string: "25"
float: 25.0
boolean: Yes
Sequences support multiple levels. Sequences are simply lists of scalars or other data structures.
# Blocked sequence
- Cat
- Dog
- Goldfish
- Languages
- Python
- Java
# Inline sequence
myflags: [GREEN, YELLOW]
mynestedflags: [APPLe, [GREEN, YELLOW], BANANA]
Mappings is also simple, and note that you can mix data types.
animal: pets
pets:
- Cat
- Dog
- Goldfish
foot: whatever
bar:
fruit: apple
name: steve
A yaml node can be anchored and later referenced elsewhere.
item:
- method: UPDATE
where: &FREE_ITEMS
- Portable Hole
- Light Feather
SellPrice: 0
BuyPrice: 0
npc:
- method: MERGE
merge-from: {name: General Goods}
items: *FREE_ITEMS
<<: *FREE # allows to merge one or more mappings as inline sequences
where: {name: !include "itemList/pve_list.yml"}