YAML八卦

YAML Ain’t Markup Language

学以致用,最近要做Go单测,需要学习了解一下Golang。其实很早就有学的愿望。学不以致用,就没下文了。十年纪念中文版链接站点看到这一篇YAML入门:以创建一个Kubernetes deployment为例。对比一下这两个等价描述,优势就一目了然了。

---
apiVersion: v1
kind: Pod
metadata:
  name: rss-site
  labels:
    app: web
spec:
  containers:
    - name: front-end
      image: nginx
      ports:
        - containerPort: 80
    - name: rss-reader
      image: nickchase/rss-php-nginx:v1
      ports:
        - containerPort: 88

{
   "apiVersion": "v1",
   "kind": "Pod",
   "metadata": {
                 "name": "rss-site",
                 "labels": {
                             "app": "web"
                           }
               },
    "spec": {
       "containers": [{
                       "name": "front-end",
                       "image": "nginx",
                       "ports": [{
                                  "containerPort": "80"
                                 }]
                      },
                      {
                       "name": "rss-reader",
                       "image": "nickchase/rss-php-nginx:v1",
                       "ports": [{
                                  "containerPort": "88"
                                 }]
                      }]
            }
}

接触了很久,但没系统了解一下。官网溜达一圈,八卦如下——

  • YAML is a human friendly data serialization standard for all programming languages.
  • 2001年5月12号发布第一版本,最早的讨论在Yahoo Group,现在已经连接失效了
  • 创世人包括Oren Ben-Kiki,Clark Evans和Ingy döt Net
  • 名字来源类似GNU的定义,YAML Ain’t Markup Language
  • 官方推荐使用.yaml结尾命名文件,目前大家似乎更多使用.yml
  • 因为tab键的实现不同,yaml采用空格方式进行描述
  • 官方网站about保留了更多信息
  • YAML正式文档目前是第三版,final YAML 1.2
  • 几乎所有主流语言都有对应的实现支持

yaml reference card

这个首页包含各个语言对yaml文件的支持项目

About:

YAML™ is an international collaboration to make a data serialization language which is both human readable and computationally powerful. The founding members of YAML are Ingy döt Net (author of the Perl module Data::Denter), Clark Evans, and Oren Ben-Kiki. YAML emerged from the union of two efforts. The first was Ingy döt Net’s need for a serialization format for Inline, this resulted in his Data::Denter module. The second, was the joint work of Oren Ben-Kiki Clark Evans on simplifying XML within the sml-dev group. YAML was first publicized with a  article on 12 May 2001. Oren and Clark’s vision for YAML was very similar to Ingy’s Data::Denter, and vice versa, thus a few days later they teamed up and YAML was born.

 
comments powered by Disqus