
namespace eval tag_map {

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

proc RECIPE {attr content} {
    process $content
}

proc NAME {attr content} {
    puts "<center><h2>"
    process $content
    puts "</h2></center>"
}

proc DESCRIPTION {attr content} {
    puts "<blockquote>"
    process $content
    puts "</blockquote>"
}

proc NOTE {attr content} {
    if {$attr == ""} {
        puts "<i>"
        process $content
        puts "</i>"
        return
    }

    # Attributes exist
    set attribute [lindex $attr 0]
    set value     [lindex $attr 1]
    switch $value {
        credit {
           puts "<br>From: <i><b>"
           process $content
           puts "</b></i><br>"
        }
        default { }
    }
}

proc INGREDIENT-LIST {attr content} {
    puts "<table border=0 bgcolor=yellow width=100%><tr><td>"
    puts "<h3>Ingredients:</h3><ul>"
    process $content
    puts "</ul></td></tr></table>"
}

proc INGREDIENT {attr content} {
    puts "<li><b>"
    process $content
    puts "</b><i>[lindex $attr 1]</i><br>"
}

proc PREPARATION {attr content} {
    puts "<table border=0 bgcolor=lightblue width=100%><tr><td>"
    puts "<h3>Preparation:</h3><ol>"
    process $content
    puts "</ol></td></tr></table>"
}

proc STEP {attr content} {
    puts "<li>"
    process $content
}

# End tag_map namespace

}
