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

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.

主站蜘蛛池模板: 龙海市| 阳春市| 敦煌市| 大冶市| 卢氏县| 蓬溪县| 临澧县| 卢氏县| 宜春市| 营口市| 贵南县| 平罗县| 垫江县| 利津县| 南陵县| 嫩江县| 车致| 托克逊县| 东明县| 勐海县| 休宁县| 巩义市| 泸定县| 滕州市| 新乡市| 乐清市| 理塘县| 比如县| 探索| 睢宁县| 柘城县| 江口县| 积石山| 深圳市| 天等县| 特克斯县| 焉耆| 长乐市| 乐安县| 青州市| 平江县|