Skip to content

Instantly share code, notes, and snippets.

@ryanpedersen42
Created September 30, 2021 08:07
Show Gist options
  • Save ryanpedersen42/5883e1a8485432a33494e364385e939e to your computer and use it in GitHub Desktop.
Save ryanpedersen42/5883e1a8485432a33494e364385e939e to your computer and use it in GitHub Desktop.
YAML example
# Key / Value
book_name: The Hobbit
# Lists
bad_guys:
- goblins
- wargs
- Gollum
- Smaug
# Nesting
Bilbo:
role: Burglar
skills:
- sneakiness
- bravery
# Anchors and Aliases
Thorin:
role: King Under the Mountain
hood_color: sky_blue
skills:
- &lead leadership # defines leadership to be used later
- mining
- battle
- smithing
Gandalf:
role: Guide
skills:
- magic
- *lead # pulling in leadership defined above. can be at any level // more or less embedded
- smoke_rings
# Achors and Aliases: Merge Maps
Gloin: &dwarf_basics
role: Member
hood_color: white
skills:
- battle
- mining
- smithing
Oin: #
<<: *dwarf_basics
hood_color: brown # overwrites the hood color above
# https://jsonformatter.org/yaml-viewer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment