sample_document.yaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. - true
  75. - True
  76. - TRUE
  77. - false
  78. - False
  79. - FALSE
  80. # http://yaml.org/type/float.html ---------------------------------------------#
  81. float:
  82. canonical: 6.8523015e+5
  83. exponentioal: 685.230_15e+03
  84. fixed: 685_230.15
  85. sexagesimal: 190:20:30.15
  86. negative infinity: -.inf
  87. not a number: .NaN
  88. # http://yaml.org/type/int.html -----------------------------------------------#
  89. int:
  90. canonical: 685230
  91. decimal: +685_230
  92. octal: 02472256
  93. hexadecimal: 0x_0A_74_AE
  94. binary: 0b1010_0111_0100_1010_1110
  95. sexagesimal: 190:20:30
  96. # http://yaml.org/type/merge.html ---------------------------------------------#
  97. merge:
  98. - &CENTER { x: 1, y: 2 }
  99. - &LEFT { x: 0, y: 2 }
  100. - &BIG { r: 10 }
  101. - &SMALL { r: 1 }
  102. # All the following maps are equal:
  103. - # Explicit keys
  104. x: 1
  105. y: 2
  106. r: 10
  107. label: nothing
  108. - # Merge one map
  109. << : *CENTER
  110. r: 10
  111. label: center
  112. - # Merge multiple maps
  113. << : [ *CENTER, *BIG ]
  114. label: center/big
  115. - # Override
  116. << : [ *BIG, *LEFT, *SMALL ]
  117. x: 1
  118. label: big/left/small
  119. # http://yaml.org/type/null.html ----------------------------------------------#
  120. null:
  121. # This mapping has four keys,
  122. # one has a value.
  123. empty:
  124. canonical: ~
  125. english: null
  126. ~: null key
  127. # This sequence has five
  128. # entries, two have values.
  129. sparse:
  130. - ~
  131. - 2nd entry
  132. -
  133. - 4th entry
  134. - Null
  135. # http://yaml.org/type/str.html -----------------------------------------------#
  136. string: abcd
  137. # http://yaml.org/type/timestamp.html -----------------------------------------#
  138. timestamp:
  139. canonical: 2001-12-15T02:59:43.1Z
  140. valid iso8601: 2001-12-14t21:59:43.10-05:00
  141. space separated: 2001-12-14 21:59:43.10 -5
  142. no time zone (Z): 2001-12-15 2:59:43.10
  143. date (00:00:00Z): 2002-12-14
  144. # JavaScript Specific Types ####################################################
  145. ################################################################################
  146. # https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp
  147. regexp:
  148. simple: !!js/regexp foobar
  149. modifiers: !!js/regexp /foobar/mi
  150. # https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined
  151. undefined: !!js/undefined ~
  152. # https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function
  153. function: !!js/function >
  154. function foobar() {
  155. return 'Wow! JS-YAML Rocks!';
  156. }