Lecture overview -- Keyboard shortcut: 'u'  Previous page: Recipe abstractions on top of HTML -- Keyboard shortcut: 'p'  Next page: Recipe datastructure (1) -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Slide 17 : 30

Recipe abstractions on top of HTML
Introducing XML-in-LAML abstractions on top of the HTML clauses
(define recipe
  (xml-in-laml-abstraction  
    (lambda (c a)
      (let ((title (defaulted-get-prop 'title a "NO TITLE"))
            (ingredient-list (get-asts c "ingredient"))
            (step-list (get-asts c "step"))
            (comment (get-asts c "comment")))
        (div 'css:margin-bottom "2cm" (span "Recipe:" title) (br)
             "Ingredients:" (br)      (ul (map li ingredient-list))
             "Procedure:" (br)        (ol (map li step-list))
             (font 'size "1" comment))))))
(recipe 'title "Pita Bread"
     (ingredient "1.5 tsp dry yeast") (ingredient "1 cup water") (ingredient "...")
     (step "Dissolve the yeast") (step "Add honey, folur and salt")  (step "...")
recipes-xml-in-laml-abstracted.laml
The entire document.
Better markup - Better parameter passing - Manual programming