#! it would be pretty hard to do most templating
#! tasks without supporting conditional logic

#@ if True:
key1a: inside-if
#@ end

#! alternatively if the conditional applies to exactly one
#! YAML node, you can use 'if/end' to avoid an extra line

#@ if/end True:
key1b: inside-if/end

#! if/end would not work for the following example
#! because it spans several YAML nodes

#@ if True:
key2a: keya
key2b: keyb
#@ end

#! it may be surprising to see the following if/end
#! apply without errors, but it works because the additional
#! nodes are children of the annotated one
#@ if/end True:
key3:
  nested_key:
    further_nesting: value1

#! we can nest 'if's in any way we want as long
#! as they are properly closed with 'end's
#@ if True:
key3a:
  #@ if True:
  nested_key: nested_value
  #@ end
#@ end

#! putting this all together, users can leverage
#! complex conditionals in their templates

#@ if True:
key4a:
  #@ something = 123
  #@ if/end something > 100 and something < 1000:
  nested_key:
    another_key: inside-if1
    #@ if something % 2 == 1:
    odd_key: odd_value1
    odd_key2: odd_value2
    #@ else:
    even_key: even_value1
    #@ end
#@ else:
key4a: inside-else1
key4b: inside-else2
#@ end
