Aller au contenu

Just enough YAML

Principalement utilisé pour écrire des fichiers de configuration.

Paire clé/valeur

1
2
3
4
Fruit: Apple
Vegetable: Carrot
Liquid: Water
Meat: Chicken

Array/Lists

1
2
3
4
5
6
7
8
9
Fruits:
- Apple
- Orange
- Banana

Vegetables:
- Carrot
- Cauliflower
- Tomato

Dictionary/Map

1
2
3
4
5
6
7
8
9
Banana:
  Calories: 105
  Fat: 0.4 g
  Carbs: 27 g

Grapes:
  Calories: 62
  Fat: 0.3 g
  Carbs: 16 g

Indentation dans YAML.

Clé/valeur/Dictionnaire/Liste

Fruits:
  - Banana:
      Calories: 105
      Fat: 0.4 g
      Carbs: 27 g

  - Grapes:
      Calories: 62
      Fat: 0.3 g
      Carbs: 16 g

https://www.educative.io/blog/yaml-tutorial