YAML was first named "Yet Another Markup Language" and later "YAML Ain't Markup Language", because even the inventors didn't know what fuck it was. For monkeys like us, it's just the other language you need to learn to pay the bills of your wife's boyfriend.
As any wrong language, it requires whitespaces for indentation, so that if you miss a space you can receive a random-generated error.
If you track the YAML errors inside your companies, you can build a cryptographically secure pseudorandom generator.
You can write lists in two ways:
- member1 - member2 - member3
[member1, member2, member3]
You can write maps in two ways, one is:
key1: value1 key2: value2
and remember to add the fucking space after ":".
{key1:value1, key2:value2}
and in this way, you do not need the fucking space.
The fuck you want, ' or " and you can escape the double quotes with \ .
No human knows how to write multiline, so there is a website for generating multiline snippet shits for monkeys like us:
yaml-multiline.info .
If you need to cat your documents, or if you need to use directives, each document must begin with ---, plus you can optionally end them with ... .
It's not mandatory if you don't need directives or concatenate YAML documents, but you will find --- everywhere because your IT is full of overpaid monkeys like us.
% at the beginning is a directive, so usually useless for the monkeys.
Referencing nodes multiple times
You can refer to a YAML node denoting it with & and referencing it with *
- shit: &shit penis: 30 - same_shit: *shit
sudo apt install yamllint
Show it in another wrong language like JSON
python3 import yaml f = open('sheet.yaml','r') yaml.safe_load(f)