# 我们的根对象 (它们在整个文件里延续) 将会是一个映射, # 它等价于在别的语言里的一个字典,哈希表或对象。 key:value another_key:Anothervaluegoeshere. a_number_value:100 # 数字 1 会被解释为数值,而不是一个布尔值。 # 如果你想要的是一个布尔值,使用 true。 scientific_notation:1e+12 boolean:true null_value:null key with spaces:value # 注意,字符串不必被括在引号中,但也可以被括起来。 however:'A string, enclosed in quotes.' 'Keys can be quoted too.':"Useful if you want to put a ':' in your key." single quotes:'have ''one'' escape pattern' double quotes:"have many: \", \0, \t, \u263A, \x0d\x0a == \r\n, and more." # UTF-8/16/32 字符需要被转义(encoded) Superscript two:\u00B2
# 多行字符串既可以写成像一个'文字块'(使用 |), # 或像一个'折叠块'(使用 '>')。 literal_block:| This entire block of text will be the value of the 'literal_block' key, with line breaks being preserved. Theliteralcontinuesuntilde-dented,andtheleadingindentationis stripped.
Anylinesthatare'more-indented'keeptherestoftheirindentation- theselineswillbeindentedby4spaces. folded_style:> This entire block of text will be the value of 'folded_style', but this time, all newlines will be replaced with a single space. Blanklines,likeabove,areconvertedtoanewlinecharacter.