YAML、YML在线编辑器(格式化校验)
---
# Collection Types #############################################################
################################################################################
# http://yaml.org/type/map.html -----------------------------------------------#
map
# Unordered set of key: value pairs.
Block style !!map
Clark Evans
Ingy döt Net
Oren Ben-Kiki
Flow style !!map Clark Evans Ingy döt Net Oren Ben-Kiki
# http://yaml.org/type/omap.html ----------------------------------------------#
omap
# Explicitly typed ordered map (dictionary).
Bestiary !!omap
aardvark African pig-like ant eater. Ugly.
anteater South-American ant eater. Two species.
anaconda South-American constrictor snake. Scaly.
# Etc.
# Flow style
Numbers !!omap one 1 two 2 three 3
# http://yaml.org/type/pairs.html ---------------------------------------------#
pairs
# Explicitly typed pairs.
Block tasks !!pairs
meeting with team.
meeting with boss.
break lunch.
meeting with client.
Flow tasks !!pairs meeting with team meeting with boss
{ map:
{ 'Block style': { Clark: 'Evans', Ingy: 'döt Net', Oren: 'Ben-Kiki' },
'Flow style': { Clark: 'Evans', Ingy: 'döt Net', Oren: 'Ben-Kiki' } },
omap:
{ Bestiary:
[ { aardvark: 'African pig-like ant eater. Ugly.' },
{ anteater: 'South-American ant eater. Two species.' },
{ anaconda: 'South-American constrictor snake. Scaly.' } ],
Numbers: [ { one: 1 }, { two: 2 }, { three: 3 } ] },
pairs:
{ 'Block tasks':
[ [ 'meeting', 'with team.' ],
[ 'meeting', 'with boss.' ],
[ 'break', 'lunch.' ],
[ 'meeting', 'with client.' ] ],
'Flow tasks': [ [ 'meeting', 'with team' ], [ 'meeting', 'with boss' ] ] } }