single.yml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. ---
  2. # Collection Types #############################################################
  3. ################################################################################
  4. # http://yaml.org/type/map.html -----------------------------------------------#
  5. map:
  6. # Unordered set of key: value pairs.
  7. Block style: !!map
  8. Clark : Evans
  9. Ingy : döt Net
  10. Oren : Ben-Kiki
  11. Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }
  12. # http://yaml.org/type/omap.html ----------------------------------------------#
  13. omap:
  14. # Explicitly typed ordered map (dictionary).
  15. Bestiary: !!omap
  16. - aardvark: African pig-like ant eater. Ugly.
  17. - anteater: South-American ant eater. Two species.
  18. - anaconda: South-American constrictor snake. Scaly.
  19. # Etc.
  20. # Flow style
  21. Numbers: !!omap [ one: 1, two: 2, three : 3 ]
  22. # http://yaml.org/type/pairs.html ---------------------------------------------#
  23. pairs:
  24. # Explicitly typed pairs.
  25. Block tasks: !!pairs
  26. - meeting: with team.
  27. - meeting: with boss.
  28. - break: lunch.
  29. - meeting: with client.
  30. Flow tasks: !!pairs [ meeting: with team, meeting: with boss ]
  31. # http://yaml.org/type/set.html -----------------------------------------------#
  32. set:
  33. # Explicitly typed set.
  34. baseball players: !!set
  35. ? Mark McGwire
  36. ? Sammy Sosa
  37. ? Ken Griffey
  38. # Flow style
  39. baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees }
  40. # http://yaml.org/type/seq.html -----------------------------------------------#
  41. seq:
  42. # Ordered sequence of nodes
  43. Block style: !!seq
  44. - Mercury # Rotates - no light/dark sides.
  45. - Venus # Deadliest. Aptly named.
  46. - Earth # Mostly dirt.
  47. - Mars # Seems empty.
  48. - Jupiter # The king.
  49. - Saturn # Pretty.
  50. - Uranus # Where the sun hardly shines.
  51. - Neptune # Boring. No rings.
  52. - Pluto # You call this a planet?
  53. Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks
  54. Jupiter, Saturn, Uranus, Neptune, # Gas
  55. Pluto ] # Overrated
  56. # Scalar Types #################################################################
  57. ################################################################################
  58. # http://yaml.org/type/binary.html --------------------------------------------#
  59. binary:
  60. canonical: !!binary "\
  61. R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\
  62. OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\
  63. +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\
  64. AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs="
  65. generic: !!binary |
  66. R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
  67. OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
  68. +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
  69. AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
  70. description:
  71. The binary value above is a tiny arrow encoded as a gif image.
  72. # http://yaml.org/type/bool.html ----------------------------------------------#
  73. bool:
  74. canonical: y
  75. answer: NO
  76. logical: True
  77. option: on
  78. # http://yaml.org/type/float.html ---------------------------------------------#
  79. float:
  80. canonical: 6.8523015e+5
  81. exponentioal: 685.230_15e+03
  82. fixed: 685_230.15
  83. sexagesimal: 190:20:30.15
  84. negative infinity: -.inf
  85. not a number: .NaN
  86. # http://yaml.org/type/int.html -----------------------------------------------#
  87. int:
  88. canonical: 685230
  89. decimal: +685_230
  90. octal: 02472256
  91. hexadecimal: 0x_0A_74_AE
  92. binary: 0b1010_0111_0100_1010_1110
  93. sexagesimal: 190:20:30
  94. # http://yaml.org/type/merge.html ---------------------------------------------#
  95. merge:
  96. - &CENTER { x: 1, y: 2 }
  97. - &LEFT { x: 0, y: 2 }
  98. - &BIG { r: 10 }
  99. - &SMALL { r: 1 }
  100. # All the following maps are equal:
  101. - # Explicit keys
  102. x: 1
  103. y: 2
  104. r: 10
  105. label: nothing
  106. - # Merge one map
  107. << : *CENTER
  108. r: 10
  109. label: center
  110. - # Merge multiple maps
  111. << : [ *CENTER, *BIG ]
  112. label: center/big
  113. - # Override
  114. << : [ *BIG, *LEFT, *SMALL ]
  115. x: 1
  116. label: big/left/small
  117. # http://yaml.org/type/null.html ----------------------------------------------#
  118. null:
  119. # This mapping has four keys,
  120. # one has a value.
  121. empty:
  122. canonical: ~
  123. english: null
  124. ~: null key
  125. # This sequence has five
  126. # entries, two have values.
  127. sparse:
  128. - ~
  129. - 2nd entry
  130. -
  131. - 4th entry
  132. - Null
  133. # http://yaml.org/type/str.html -----------------------------------------------#
  134. string: abcd
  135. # http://yaml.org/type/timestamp.html -----------------------------------------#
  136. timestamp:
  137. canonical: 2001-12-15T02:59:43.1Z
  138. valid iso8601: 2001-12-14t21:59:43.10-05:00
  139. space separated: 2001-12-14 21:59:43.10 -5
  140. no time zone (Z): 2001-12-15 2:59:43.10
  141. date (00:00:00Z): 2002-12-14
  142. # JavaScript Specific Types ####################################################
  143. ################################################################################
  144. # https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp
  145. regexp:
  146. simple: !!js/regexp foobar
  147. modifiers: !!js/regexp /foobar/mi
  148. # https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined
  149. undefined: !!js/undefined ~
  150. # https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function
  151. function: !!js/function >
  152. function foobar() {
  153. return 'Wow! JS-YAML Rocks!';
  154. }