
namespace eval tag_map {

# ----------------------------------------

proc RECIPE {attr content} {
    puts "insert into recipe (id) values (1);"
    process $content
}

proc NAME {attr content} {
    puts "update recipe set name='[process $content]';"
}

proc DESCRIPTION {attr content} {
    puts "update recipe set description='[process $content]';"
}

proc NOTE {attr content} {
    # Ignored
    return
}

proc INGREDIENT-LIST {attr content} {
    process $content
}

proc INGREDIENT {attr content} {
    puts "insert into ingredients values (1, '[lindex $attr 1]', '[process $content]');"
}

proc PREPARATION {attr content} {
    process $content
}

proc STEP {attr content} {
    global step_num
    if {![info exists step_num]} { set step_num 0 }
    incr step_num
    puts "insert into prep values (1, $step_num, '[process $content]');"
}

# End tag_map namespace

}
