文档章节

YAML Tutorial

cyper
 cyper
发布于 2015/10/02 12:38
字数 315
阅读 312
收藏 2

YAML Rules

  • Applicable YAML files: all files with a .yml extension.
    • Essentials uses a config.yml file.
  • Tabs are NOT allowed, use spaces ONLY.
  • You MUST indent your properties and lists with 1 or more spaces.
  • All keys/properties are case-sensitive. ("ThIs", is not the same as "thiS")

YAML Parser

ALWAYS check your YAML config files against this parser:  YAML ParserWhen using the parser,  CORRECT output looks like this:  Image:Output.pngThe file used for the tutorial and for the output is here:  HelloWorld


Text Editor Use

Please use  notepad++ (free) or another program to convert your TABs to spaces if you want to easily edit your YAML config files using the TAB key. If you do  NOT have a program which can convert TABs to spaces, then  do NOT use the TAB key to indent your YAML.


Within  notepad++ Click Settings  -> Preferences  -> Language Menu/Tab Settings, which will take you to the following screen. Noteplusplus.png


YAML Key-Property Structure Tutorial

Notice that the properties are spaced 2 from the margin. This is called indenting. YAML is very strict with indentation and it MUST be done every time you add a new property to a key.


Notice that this key-property structure and the above one are similar, but are fundamentally different (by YAML standards that is).


"The keys helloworld and HelloWorld are identical except for their case. Don't forget this. YAML will treat these keys as two separate and unrelated keys."


Take notice of the different types of values and how you're able to use them with stand-alone keys. No, you do not need the keyword key for those to be valid keys. Keys can have any name as long as the name only contains letters.


Your lists structure must look IDENTICAL to the one below or errors will occur. You might be able to get away with a little more indentation before the "-", but that's it.

本文转载自:http://ess.khhq.net/wiki/YAML_Tutorial

下一篇: ​css float
cyper

cyper

粉丝 59
博文 685
码字总数 143352
作品 0
武汉
前端工程师
私信 提问
ROS下orb-slam2 单目 (二)

一 /1. 修改 /ORBSLAM2/Examples/ROS/ORBSLAM2/src/ros_mono.cc 的节点为 “camera/image” 2. 启动 1) roscore 2) rosrun videotransporttutorial video_publisher 3) rosrun ORBSLAM2 Mon......

v7xyy
2017/10/07
0
0
python环境下的yaml使用

使用方法来自官网http://pyyaml.org/wiki/PyYAMLDocumentation PyYAML is now maintained at https://github.com/yaml/pyyaml. This page is left for historical purposes. Installation Do......

langb2014
2017/12/08
0
0
Getting Started With Ambassador

Ambassador is a Kubernetes-native API gateway for microservices built on the Envoy Proxy. Ambassador is designed for self-service. Developers should be able to manage basic aspe......

Richard Li
2017/12/27
0
0
搭建yii2测试网页记录

参考网页+ http://www.cnblogs.com/txw1958/p/wechat-tutorial.html+ http://www.sinacloud.com/doc/sae/php/mysql.html#deferredjob 申请服务器资源 这一部分,基本全部照抄参考网页的内容,......

不避风云
2016/02/12
288
0
搭建storm集群(apache-storm-0.9.5.tar.gz)

前期准备:3台服务器: 192.168.1.115 192.168.1.116 192.168.1.117 去storm官网下载响应版本的软件包:http://storm.apache.org/downloads.html 在这里下载的是: wget http://mirrors.hust...

chaun
2016/10/27
76
0

没有更多内容

加载失败,请刷新页面

加载更多

PostgreSQL 11.3 locking

rudi
今天
5
0
Mybatis Plus sql注入器

一、继承AbstractMethod /** * @author beth * @data 2019-10-23 20:39 */public class DeleteAllMethod extends AbstractMethod { @Override public MappedStatement injectMap......

一个yuanbeth
今天
10
1
一次写shell脚本的经历记录——特殊字符惹的祸

本文首发于微信公众号“我的小碗汤”,扫码文末二维码即可关注,欢迎一起交流! redis在容器化的过程中,涉及到纵向扩pod实例cpu、内存以及redis实例的maxmemory值,statefulset管理的pod需要...

码农实战
今天
4
0
为什么阿里巴巴Java开发手册中不建议在循环体中使用+进行字符串拼接?

之前在阅读《阿里巴巴Java开发手册》时,发现有一条是关于循环体中字符串拼接的建议,具体内容如下: 那么我们首先来用例子来看看在循环体中用 + 或者用 StringBuilder 进行字符串拼接的效率...

武培轩
今天
8
0
队列-链式(c/c++实现)

队列是在线性表功能稍作修改形成的,在生活中排队是不能插队的吧,先排队先得到对待,慢来得排在最后面,这样来就形成了”先进先出“的队列。作用就是通过伟大的程序员来实现算法解决现实生活...

白客C
今天
81
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部