YAML Flashcards
Describe the following YAML syntax:
- Apple - Orange - Strawberry - Mango
This is a YAML list.
All members of a list are lines beginning at the same indentation level starting with a “- “ (a dash and a space)
Describe the following YAML syntax:
martin: name: Martin D'vloper job: Developer skill: Elite
This is a basic YAML dictionary.
A dictionary is represented in a simple ‘key: value’ form (the colon must be followed by a space)
Describe the following YAML syntax:
- martin: name: Martin D'vloper job: Developer skills: - python - perl - pascal - tabitha: name: Tabitha Bitumen job: Developer skills: - lisp - fortran - erlang
This is a complex YAML structure featuring a list at the outermost level. Each list contains a dictionary. Inside those dictionaries, some of the values are lists.
Describe the following YAML syntax:
martin: {name: Martin D'vloper, job: Developer, skill: Elite} fruits: ['Apple', 'Orange', 'Strawberry', 'Mango']
These are the abbreviated forms of YAML dictionaries and lists respectively.
Describe the following YAML syntax:
include_newlines: | exactly as you see will appear these three lines of poetry
The ‘|’ character in YAML is the Literal Block Scalar.
Values spanning multiple lines that begin with a ‘|’ will include any newlines and any trailing spaces.
Describe the following YAML syntax:
fold_newlines: > this is really a single line of text despite appearances
The ‘>’ character in YAML is known as the Folded Block Scalar.
This character will fold newlines to spaces; it is used to make what would otherwise be a very long line easier to read and edit.
“\n” escape sequences can be used in a folded block to enforce newlines to be included.