How to Write a Number in YAML
In YAML, a number is written as it is, without quotes: 3 or 12.5. In quotes, the same digits are text.
- Programming
- YAML
In YAML, a number is written as it is, without quotes: 3 or 12.5. In quotes, the same digits are text.
In YAML, # starts a comment: everything after it on that line is a note that programs skip.
YAML reads true and false, written without quotes, as booleans: values that are either on or off.
Put a YAML value in double quotes when it contains characters such as a colon and a space, so YAML reads it as plain text.
Write > after a key to spread a long string over several lines. YAML folds the lines into one, joined by spaces.
In a YAML list of objects, a dash starts each object, and its other keys line up under its first key.
Write a YAML list as a key followed by one item per line, each after a dash and a space.
Indent keys under a parent key to nest them in YAML. Use spaces, and give every child of the same parent the same indent.
A YAML key-value pair is a key, a colon, a space and the value. One pair per line builds a whole YAML file.