Wiki/Cheatsheets/yaml.md
2025-05-05 01:51:50 +02:00

682 B

YAML Ain't Markup Language

# Comment

key: value
key: "string\nstring"
key: string
key: 'string'
key: 123

object:
  key: value
  key2: value2

object-list:
  - list-item: value
    key: value
  - list-item: value2
    key: value2

object-list: [value1, value2, value3]

key: |
  This is a multiline value
  it takes everything untill the next key

key: >
  This is a single line value
  but it is written on multiple lines
  just for readability

key: "$USER" #Yes Variables work

--- File divider to put multiple YAML configs in 1 file

command:
  - sh
  - -c
  - |
    #!/bin/bash
    printf "Hello World!"
    exit
  - echo  "Yes I just ran a bash script using YAML"