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

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.

主站蜘蛛池模板: 莱州市| 阿拉善右旗| 信宜市| 寿阳县| 抚宁县| 镇雄县| 策勒县| 海丰县| 芜湖县| 清涧县| 西乡县| 蓬溪县| 浦北县| 集贤县| 新乐市| 清徐县| 泌阳县| 格尔木市| 连山| 庆阳市| 虹口区| 尼勒克县| 大田县| 石渠县| 汾西县| 胶州市| 洪雅县| 临漳县| 荥阳市| 永靖县| 蒙山县| 酒泉市| 合阳县| 卓资县| 大悟县| 保山市| 澄城县| 日土县| 元谋县| 彰化县| 东城区|