YAML syntax compared with Ruby syntax

yaml4r Show archive.org snapshot is a juxtaposition of yaml documents and their Ruby couterpart. Thus, it does a great job as YAML-doc, e.g. when writing Rails locale files. Did you know that ...

  • << is a merge key (similar to & in SASS)
  • there are variables, called aliases. Definition: &alias Some content, usage: *alias.

Caveats

Specifying a key twice does not merge the sub keys, but override the first definition, e.g.

de:
  car: # overridden
    door: Tür
    wheel: Rad
  car: # only this is used
    engine: Motor
Dominik Schöler About 11 years ago