YtsDocumentSeparator.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. --- %YAML:1.0
  2. test: Trailing Document Separator
  3. todo: true
  4. brief: >
  5. You can separate YAML documents
  6. with a string of three dashes.
  7. yaml: |
  8. - foo: 1
  9. bar: 2
  10. ---
  11. more: stuff
  12. python: |
  13. [
  14. [ { 'foo': 1, 'bar': 2 } ],
  15. { 'more': 'stuff' }
  16. ]
  17. ruby: |
  18. [ { 'foo' => 1, 'bar' => 2 } ]
  19. ---
  20. test: Leading Document Separator
  21. todo: true
  22. brief: >
  23. You can explicitly give an opening
  24. document separator to your YAML stream.
  25. yaml: |
  26. ---
  27. - foo: 1
  28. bar: 2
  29. ---
  30. more: stuff
  31. python: |
  32. [
  33. [ {'foo': 1, 'bar': 2}],
  34. {'more': 'stuff'}
  35. ]
  36. ruby: |
  37. [ { 'foo' => 1, 'bar' => 2 } ]
  38. ---
  39. test: YAML Header
  40. todo: true
  41. brief: >
  42. The opening separator can contain directives
  43. to the YAML parser, such as the version
  44. number.
  45. yaml: |
  46. --- %YAML:1.0
  47. foo: 1
  48. bar: 2
  49. php: |
  50. array('foo' => 1, 'bar' => 2)
  51. documents: 1
  52. ---
  53. test: Red Herring Document Separator
  54. brief: >
  55. Separators included in blocks or strings
  56. are treated as blocks or strings, as the
  57. document separator should have no indentation
  58. preceding it.
  59. yaml: |
  60. foo: |
  61. ---
  62. php: |
  63. array('foo' => "---\n")
  64. ---
  65. test: Multiple Document Separators in Block
  66. brief: >
  67. This technique allows you to embed other YAML
  68. documents within literal blocks.
  69. yaml: |
  70. foo: |
  71. ---
  72. foo: bar
  73. ---
  74. yo: baz
  75. bar: |
  76. fooness
  77. php: |
  78. array(
  79. 'foo' => "---\nfoo: bar\n---\nyo: baz\n",
  80. 'bar' => "fooness\n"
  81. )