Yaml

Amos Xia, 2018-04-30 13:28:12

Yaml for configuration

Basic

Use to separate YAML Documents in one yaml file.

Use *** to declare the end of file.

Use # for annotation

It use indent and left-align to orgnize data in file.

There are 2 kinds of format: block format and inline format.

Array

// Array block format
- ...
- ...
- ...

// Array inline format
[..., ..., ...]

Hashtable

// block format
// key: value
name: XYY
age: 33

// inline format
// {key: value, ...}
{name: XYY, age: 33}

String

It’s not necessary to use quotes() for string.

Multi-line strings - |, keep \n - >, collapse words

Advance

Reuse

Use & to mark a reference of data that could be reused in somewhere by *.

Merge hashtable

Use <<: to merge values of another hashtable into current hashtable.

Type conversion

Reference


知识共享许可协议
本作品采用知识共享署名 4.0 国际许可协议进行许可。


Copyright© 2018 s2u2m