Guest User

Untitled

a guest
Nov 15th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. # Comments in YAML look like this.
  2.  
  3. ################
  4. # SCALAR TYPES #
  5. ################
  6.  
  7. key: value
  8. another_key: Another value goes here.
  9. a_number_value: 100
  10. scientific_notation: 1e+12
  11. # The number 1 will be interpreted as a number, not a boolean. if you want
  12. # it to be interpreted as a boolean, use true
  13. boolean: true
  14. null_value: null
  15. key with spaces: value
  16. # Notice that strings don't need to be quoted. However, they can be.
  17. however: 'A string, enclosed in quotes.'
  18. 'Keys can be quoted too.': "Useful if you want to put a ':' in your key."
  19. single quotes: 'have ''one'' escape pattern'
  20. double quotes: "have many: \", \0, \t, \u263A, \x0d\x0a == \r\n, and more."
  21.  
  22. # Multiple-line strings can be written either as a 'literal block' (using |),
  23. # or a 'folded block' (using '>').
  24. literal_block: |
  25. This entire block of text will be the value of the 'literal_block' key,
  26. with line breaks being preserved.
  27.  
  28. The literal continues until de-dented, and the leading indentation is
  29. stripped.
  30.  
  31. Any lines that are 'more-indented' keep the rest of their indentation -
  32. these lines will be indented by 4 spaces.
  33. folded_style: >
  34. This entire block of text will be the value of 'folded_style', but this
  35. time, all newlines will be replaced with a single space.
  36.  
  37. Blank lines, like above, are converted to a newline character.
  38.  
  39. 'More-indented' lines keep their newlines, too -
  40. this text will appear over two lines.
  41.  
  42. ####################
  43. # COLLECTION TYPES #
  44. ####################
  45.  
  46. # Nesting uses indentation. 2 space indent is preferred (but not required).
  47. a_nested_map:
  48. key: value
  49. another_key: Another Value
  50. another_nested_map:
  51. hello: hello
  52.  
  53. # Maps don't have to have string keys.
  54. 0.25: a float key
  55.  
  56. # Sequences (equivalent to lists or arrays) look like this
  57. # (note that the '-' counts as indentation):
  58. a_sequence:
  59. - Item 1
  60. - Item 2
  61. - 0.5 # sequences can contain disparate types.
  62. - Item 4
  63. - key: value
  64. another_key: another_value
  65. -
  66. - This is a sequence
  67. - inside another sequence
  68. - - - Nested sequence indicators
  69. - can be collapsed
  70.  
  71. # Since YAML is a superset of JSON, you can also write JSON-style maps and
  72. # sequences:
  73. json_map: {"key": "value"}
  74. json_seq: [3, 2, 1, "takeoff"]
  75. and quotes are optional: {key: [3, 2, 1, takeoff]}
Add Comment
Please, Sign In to add comment