"YAML"의 두 판 사이의 차이

 
(사용자 3명의 중간 판 23개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;YAML
;YAML (YAML Aint't Markup Language)
;얘멀 /ˈjæməl/, 얘믈, 야믈
* 데이터 교환 형식의 하나
* 사람이 읽을 수 있도록 정한 데이터 직렬화 형식
* 사람이 읽을 수 있도록 정한 데이터 직렬화 형식
* C, Perl, PHP, Python, 루비, 자바스크립트 등에서 사용가능
* C, Perl, PHP, Python, 루비, 자바스크립트 등에서 사용가능
* 모든 데이터를 리스트, 해쉬, 스칼라 데이터의 조합으로 표현
* 모든 데이터를 리스트, 해쉬, 스칼라 데이터의 조합으로 표현
* 확장자: <code>.yaml</code>, <code>.yml</code>
* 첫 릴리즈: 2001년


== 예시 ==
== 예시 ==
=== 리스트 ===
=== 리스트 ===
<source lang="yaml">
<syntaxhighlight 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>
</syntaxhighlight>
 
=== 해시 ===
=== 해시 ===
<source lang="yaml">
<syntaxhighlight lang="yaml">
--- # Block
--- # Block
name: John Smith
name: John Smith
age: 33
age: 33
--- # Inline
--- # Inline
{name: John Smith, age: 33}
{name: John Smith, age: 33}
</source>
</syntaxhighlight>
 
=== 블럭 리터럴 ===
=== 블럭 리터럴 ===
{{참고|YAML 블럭 리터럴}}
==== 개행 보존 ====
==== 개행 보존 ====
<source lang="yaml">
<syntaxhighlight lang="yaml">
--- |
--- |
  There was a young fellow of Warwick
  There was a young fellow of Warwick
  Who had reason for feeling euphoric
  Who had reason for feeling euphoric
      For he could, by election
      For he could, by election
      Have triune erection
      Have triune erection
  Ionic, Corinthian, and Doric
  Ionic, Corinthian, and Doric
</source>
</syntaxhighlight>
 
==== 개행 무시 ====
==== 개행 무시 ====
<source lang="yaml">
<syntaxhighlight lang="yaml">
--- >
--- >
  Wrapped text
  Wrapped text
  will be folded
  will be folded
  into a single
  into a single
  paragraph
  paragraph
 
 
  Blank lines denote
  Blank lines denote
  paragraph breaks
  paragraph breaks
</source>
</syntaxhighlight>
 
=== 해시의 리스트 ===
=== 해시의 리스트 ===
<source lang="yaml">
<syntaxhighlight lang="yaml">
- {name: John Smith, age: 33}
- {name: John Smith, age: 33}
- name: Mary Smith
- name: Mary Smith
  age: 27
  age: 27
</source>
</syntaxhighlight>
=== 리스트의 해시 ===
=== 리스트의 해시 ===
<source lang="yaml">
<syntaxhighlight lang="yaml">
men: [John Smith, Bill Jones]
men: [John Smith, Bill Jones]
women:
women:
  - Mary Smith
  - Mary Smith
  - Susan Williams
  - Susan Williams
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[JSON]]
{{z컬럼3|
*[[XML]]
* [[Plist]]
* [[XML]]
* [[JSON]]
* [[TOML]]
* [[OGDL]]
* [[AsciiDoc]]
* [[리눅스 yq]]
* [[리눅스 shyaml]]
}}


==참고 자료==
==참고==
* http://www.yaml.org/
* http://www.yaml.org/
* http://www.yaml.org/refcard.html
* http://www.yaml.org/refcard.html
* https://ko.wikipedia.org/wiki/YAML
* {{위키백과|YAML}}
* RFC 2822
* RFC 2822
* https://sebiwi.github.io/comics/yaml/ YAML 《Sebiwi》 2018-02-19


[[분류: 직렬화]]
[[분류: YAML]]
[[분류: 마크업 언어]]
[[분류: yet another]]

2023년 1월 19일 (목) 23:56 기준 최신판

1 개요[ | ]

YAML (YAML Aint't Markup Language)
얘멀 /ˈjæməl/, 얘믈, 야믈
  • 데이터 교환 형식의 하나
  • 사람이 읽을 수 있도록 정한 데이터 직렬화 형식
  • 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 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}