YAML is "YAML Is not a Markup Language" (YAML is not a markup language) is a recursive acronym. In the development of the language, YAML meant in fact: "Yet Another Markup Language" (still a markup language).
YAML configuration file suffix .yml, such as: runoob.yml .
The basic syntax
- Case Sensitive
- Use indention hierarchy
- Indent does not allow tab, allowing only spaces
- The number of spaces to indent unimportant, as long as the left elements aligned to the same level
- '#' Denotes a comment
type of data
YAML supports the following data types:
- Object: a set of keys, also known as mapping (mapping) / hashes (hashes) / Dictionary (dictionary)
- Array: a set of values are arranged in order, also known sequence (sequence) / list (list)
- Scalar (scalars): individual, can not be divided value
YAML objects
Object key structure expressed on the use of colon Key: value , a colon to add a space.
May also be used Key: {key1: VALUE1, key2: value2, ...} .
You can also use indention hierarchy;
key: child-key: value child-key2: value2
YAML array
To - the beginning of the line shows the configuration of an array:
- A - B - C