"YAML"의 두 판 사이의 차이

12번째 줄: 12번째 줄:
=== 리스트 ===
=== 리스트 ===
<source lang="yaml">
<source lang="yaml">
--- # Favorite movies, block format
--- # Favorite movies, block format
- Casablanca
- Casablanca
- Spellbound
- Spellbound
- Notorious
- Notorious
--- # Shopping list, inline format
--- # Shopping list, inline format
[milk, bread, eggs]
[milk, bread, eggs]
</source>
</source>
=== 해시 ===
=== 해시 ===
<source lang="yaml">
<source lang="yaml">

2017년 4월 11일 (화) 17:04 판

1 개요

YAML
얘멀[1]
  • 데이터 교환 형식의 하나
  • 사람이 읽을 수 있도록 정한 데이터 직렬화 형식
  • C, Perl, PHP, Python, 루비, 자바스크립트 등에서 사용가능
  • 모든 데이터를 리스트, 해쉬, 스칼라 데이터의 조합으로 표현
  • 확장자: .yaml, .yml
  • 첫 릴리즈: 2001년

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 참고 자료

  1. /ˈjæməl/
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}