---player:playerOneaction:attack(miss)---player:playerTwoaction:attack(hit)--- 内置注释 YAML允许您使用#,类似于Python注释向文件添加注释。 代码语言:javascript 复制 key:#Here is a single-line comment-value line5#Here is a #multi-line comment-value line13 可读的语法 YAML文件使用类似于Python的...
例如,你想通过换行让 YAML 更加易读,而真正展示的时候是单行: single-line-string:>This should be one line 这就是它在 JSON 中的样子: {"single-line-string":"This should be one line\n"} Notion: 当使用>字符而不是 时|,每一个新行都将被解释为一个空格。 数值(Number) 数值有整数、小数、正数...
每个文档之间的分隔由三个破折号(---)标记。 ---player: playerOneaction: attack (miss)---player: playerTwoaction: attack (hit)--- 内建注释 YAML 允许使用类似于 Python 注释的井号(#)向文件添加注释。 key: #Here is a single-line comment- value line 5#Here is a#multi-line comment- value ...
one line see? 但是解析器会把他们解析成单行字符串: 代码语言:javascript 复制 bar:thisis not a normal string it spans more than one line see? 如果想让YAML把上面的字符串也解析成多行的,需要使用管道符| 代码语言:javascript 复制 bar:|thisis not a normal string it spans more than one line see?
---# document start# Comments in YAML look like this.# YAML supports single-line comments.### SCALAR TYPES ### Our root object (which continues for the entire document) will be a map,# which is equivalent to a dictionary, hash or object in other languages.key:valueanother_key:Another ...
bar : this is not a normal string it spans more than one line see? The block (pipe) character has a similar function, but YAML interprets the field exactly as is. bar: | this is not a normal string it spans more than one line see? So, we see the newlines where they are in the...
bar : this is not a normal string it spans more than one line see? 如果想让YAML把上面的字符串也解析成多行的,需要使用管道符| bar: | this is not a normal string it spans more than one line see? Null YAML里用波浪号~或者不带引号的null直接表示空值。
however: 'A string, enclosed in quotes.' 'Keys can be quoted too.': "Useful if you want to put a ':' in your key." single quotes: 'have ''one'' escape pattern' double quotes: "have many: \", \0, \t, \u263A, \x0d\x0a == \r\n, and more." # Multiple-line strings...
however: 'A string, enclosed in quotes.' 'Keys can be quoted too.': "Useful if you want to put a ':' in your key." single quotes: 'have ''one'' escape pattern' double quotes: "have many: \", \0, \t, \u263A, \x0d\x0a == \r\n, and more." # Multiple-line strings...
role: master spec: ports: - port: 6379 targetPort: 6379 selector: app: redis tier: backend role: master --- apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment ...