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

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.

主站蜘蛛池模板: 勐海县| 甘孜县| 响水县| 获嘉县| 旅游| 肇东市| 镇远县| 彰化市| 西林县| 米易县| 孟连| 鄂伦春自治旗| 朝阳县| 库伦旗| 阜宁县| 会泽县| 盐山县| 溧水县| 武穴市| 平远县| 博爱县| 泰州市| 仁布县| 定日县| 荔浦县| 大庆市| 灯塔市| 通渭县| 惠州市| 鹤岗市| 工布江达县| 凤庆县| 宝丰县| 阿勒泰市| 台东市| 韶关市| 张北县| 沙河市| 华坪县| 石城县| 张掖市|