官术网_书友最值得收藏!

YAML

YAML, like many other data serialization languages (such as JSON), has very few, basic concepts:

  • Declarations
  • Lists
  • Associative arrays

A declaration is very similar to a variable in any other language, which is as follows:

name: 'This is the name'

To create a list, we will have to use -:

- 'item1' 
- 'item2'
- 'item3'

YAML uses indentation to logically divide parents from children. So, if we want to create associative arrays (also known as objects), we would just need to add an indentation:

item: 
name: TheName
location: TheLocation

Obviously, we can mix those together as follows:

people:
- name: Albert
number: +1000000000
country: USA
- name: David
number: +44000000000
country: UK

Those are the basics of YAML. YAML can do much more, but for now, this will be enough.

主站蜘蛛池模板: 张家界市| 西宁市| 南宫市| 磴口县| 中超| 赤水市| 改则县| 苍梧县| 江阴市| 吐鲁番市| 长汀县| 承德市| 京山县| 且末县| 凤冈县| 太白县| 凤台县| 册亨县| 永年县| 定安县| 包头市| 福建省| 习水县| 巴塘县| 孝义市| 石河子市| 达孜县| 图木舒克市| 青田县| 丁青县| 镇康县| 兴安县| 鄢陵县| 黄梅县| 三明市| 安多县| 南乐县| 怀来县| 宝鸡市| 东台市| 扶余县|