Detailed file yml

YAML (/ jæməl /, similar to the tail camel camels) is a highly readable, the data used to express serialization format. YAML reference to other languages, including: C, Python, Perl, and get inspiration from XML, e-mail data format (RFC 2822) in. Clark Evans in 2001 and first published in this language, in addition Ingy döt Net and Oren Ben-Kiki is also the designer of this common language. There have been several current programming or scripting language support (or resolve) this language.

YAML is "YAML Is not a Markup Language" (YAML is not a markup language) is a recursive acronym. In the development of the language, YAML meant in fact: "Yet Another Markup Language" (still a markup language, but the language in order to emphasize data as a center, rather than focusing on the markup language, but with reverse Abbreviations rename

Features

YAML syntax and other similar high-level language and can express simple lists, hash tables, scalar and other forms of data. It uses whitespace indentation and rely heavily on appearance characteristics, especially suitable for expressing or edit data structures, various configuration files, debug dump the contents of the file outline (example: Many e-mail headers and YAML format is very close). Although it is more suitable for expression data structures hierarchical structure (hierarchical model), but also with fine relational data syntax (relational model) can be expressed. Since YAML whitespace and branches to separate the data, making it particularly suitable for use grep / Python / Perl / Ruby operation. It makes the most ingenious feature is easy to use to avoid the closure of various symbols, such as: quotes, various brackets, etc., these symbols in the nested structure can become complex and difficult to identify

The basic components of the YAML

YAML provides indent / block and built (inline) formats, to represent lists and hash tables. The following shows the basic YAML several of the original.

The basic syntax

k :( space) v: represents a key-value pair (spaces not shown) to control the space hierarchy, as long as the data is left-justified, are of the same level;

Note: The attributes and values ​​are case sensitive

server:  port: 8083  path: /helloBoot

 

Value wording:

Literal: numbers, strings, Boolean (Boolean) values ​​(not the default string in single or double quotation marks);

     "" (Double quotation marks): No escape string inside special characters, special characters as themselves want to say

     eg: name: "Hello Boot \ n !!!" --- Output: Hello Boot wrap !!!

     '' (Single quote): will escape special characters, special characters ultimately is just a string of data

     eg:      name: 'Hello Boot \n !!!'  ---   输出: Hello Boot \n !!!

Object: Map (key: value);

     The relationship between attributes and values ​​of an object to write the next line: k: v

person:    name: boot    age: 18

     Inline wording:

person: {name: boot,age: 18}

Array (represented by - an element of the array):

animal: -cat -day -Pig

Inline wording:

animal: [cat, dog, pig ]
Reference link: https: //blog.csdn.net/Java_Glory/article/details/89452418

Link: https: //www.jianshu.com/p/a65e692edd5a

 

Published 100 original articles · won praise 18 · views 30000 +

Guess you like

Origin blog.csdn.net/sereasuesue/article/details/105294236