title: YAML Multi-Line Arrays
body: <p>In <a href="http://yaml.org/spec" rel="noreferrer">YAML</a>, you can easily create <a href="https://stackoverflow.com/questions/3790454/in-yaml-how-do-i-break-a-string-over-multiple-lines">multi-line strings</a>. However, I would like the ability to create a multi-line array (mainly for readibility within config files) using the <code>|</code> character.</p>
  
  <p>A YAML <strong>array</strong> can be represented as: <code>['key1', 'key2', 'key3']</code>.</p>
  
  <p>A YAML <strong>sequence</strong> uses a dash followed by a space and then a string:</p>
  
  <pre><code>- String1
  - String2
  - String3
  </code></pre>
  
  <p>This would evaluate to: <code>['string1', 'string2', 'string3']</code>.</p>
  
  <p>A YAML <strong>mapping</strong> is an array of key and value pairs that we see all the time in YAML:</p>
  
  <pre><code>Key1: string1
  Key2: string2
  Key3: string3
  </code></pre>
  
  <p>This is all well and good, but I can't for the life of me see how to do a multi-line array. Something like this:</p>
  
  <pre><code>|
  ['string1', 'string2', 'string3']
  ['string4', 'string5', 'string6']
  </code></pre>
  
  <p>Short of creating multiple array mappings in YAML and merging them in my programming language of choice, is there any way to achieve multi-line arrays, maybe with <code>{ }</code> like Python has but in YAML?</p>