YAML의 문자열(string)은 일반적으로 다음처럼 사용한다.







1
2
3
4
5
A string in YAML

'A singled-quoted string in YAML'

"A double-quoted string in YAML"



multi-line은 어떻게 표시할까? (사실 이번에 처음 알았다.. YAML에 multi line이 있을 줄이야..)

pipe(|) 또는 >를 사용한다. 



When a string contains line breaks, you can use the literal style, indicated by the pipe (|), to indicate that the string will span several lines. In literals, newlines are preserved:

1
2
3
|
  \/ /| |\/| |
  / / | |  | |__

Alternatively, strings can be written with the folded style, denoted by >, where each line break is replaced by a space:

1
2
3
4
5
>
  This is a very long sentence
  that spans several lines in the YAML
  but which will be rendered as a string
  without carriage returns.



출처 : http://symfony.com/doc/current/components/yaml/yaml_format.html

Posted by 김용환 '김용환'