"YAML"의 두 판 사이의 차이

61번째 줄: 61번째 줄:
*[[JSON]]
*[[JSON]]
*[[XML]]
*[[XML]]
*[[AsciiDoc]]
*[[OGDL]]
*[[Plist]]


==참고 자료==
==참고 자료==

2015년 12월 15일 (화) 17:12 판

1 개요

YAML
  • 사람이 읽을 수 있도록 정한 데이터 직렬화 형식
  • C, Perl, PHP, Python, 루비, 자바스크립트 등에서 사용가능
  • 모든 데이터를 리스트, 해쉬, 스칼라 데이터의 조합으로 표현

2 예시

2.1 리스트

 --- # Favorite movies, block format
 - Casablanca
 - Spellbound
 - Notorious
 --- # Shopping list, inline format
 [milk, bread, eggs]

2.2 해시

 --- # Block
 name: John Smith
 age: 33
 --- # Inline
 {name: John Smith, age: 33}

2.3 블럭 리터럴

2.3.1 개행 보존

 --- |
   There was a young fellow of Warwick
   Who had reason for feeling euphoric
       For he could, by election
       Have triune erection
   Ionic, Corinthian, and Doric

2.3.2 개행 무시

 --- >
   Wrapped text
   will be folded
   into a single
   paragraph
   
   Blank lines denote
   paragraph breaks

2.4 해시의 리스트

 - {name: John Smith, age: 33}
 - name: Mary Smith
   age: 27

2.5 리스트의 해시

 men: [John Smith, Bill Jones]
 women:
   - Mary Smith
   - Susan Williams

3 같이 보기

4 참고 자료