;; TODO (define (expand x) (match x (($ text) `(p ,text)) (($
name) `(h1 ,name)) (($ elements) `(li ,@(map expand elements))) (($ quantity unit) (list "(" (number->string quantity) unit ")")) (($ (or ) name amount) `(span ,@(if name (list name) '()) ,@(if amount (expand amount) '()))) (($ metadata body) `((@raw "") (html (body (ol ,@(expand body)))))) ((? list? x) (map expand x)) ((? string? x) x) (else ""))) (define (recipe->html recipe) (let ((ingredients (recipe-ingredients recipe)) (cookware (recipe-cookware recipe)) (timers (recipe-timers recipe))) #;(for-each (lambda (x) (display (ingredient-name x)) (display ": ") (when (ingredient-amount x) (display (amount-quantity (ingredient-amount x))) (display (amount-unit (ingredient-amount x)))) (newline)) ingredients) (sxml->xml (expand recipe))))