Yaml File Structure

DONT FORGET TO REPLACE ME LATER

YAML (YAML Ain’t Markup Language) is a human-friendly data serialization standard, commonly used for configuration files and data exchange between languages with different data structures. Here’s a breakdown of its file structure:

1. Basic Structure

A YAML file is composed of key-value pairs, lists, and nesting (indentation is critical):

key: value               # Simple key-value pair
another_key: 123         # Numbers, booleans, and nulls are supported

2. Indentation

Nesting is indicated by indentation (spaces only, not tabs):

parent:
  child: value

3. Lists

Lists can be written using dashes:

fruits:
  - apple
  - banana
  - cherry

4. Dictionaries (Mappings)

You can nest dictionaries:

person:
  name: Alice
  age: 30
  skills:
    - Python
    - YAML

5. Comments

Use # for comments:

# This is a comment
key: value  # Inline comment

6. Multi-line Strings

Strings can span multiple lines:

description: |
  This is a
  multi-line string.

7. Example YAML File

Here’s a complete example:

server:
  host: localhost
  port: 8080

users:
  - name: Alice
    role: admin
  - name: Bob
    role: user

debug: true

Key Points

Let me know if you want a deeper dive or examples for a specific use case!