To insert useful snippets of scheme into your html use the web template module: (use-modules (web template)) create a file which defines a hash-table that holds what the various snippets do. It can be any name but here it's called "htags.scm" { (define htags (make-hash-table )) ;; Initialize command table (hash-set! htags 'test (lambda () (format #f "TEST"))) } *It defines a tag named 'test' that simply prints "TEST" when it's called load that file from the main file { (load "htags.scm") } Create a file that holds the content (here creatively called "file") { first line
third line
} use an htag by putting the tag in between square brackets. to bind it all together, use the template:parse function { (display "Content-type: text/html")(newline)(newline) (map display (template:parse htags (open-input-string (read-delimited "" (open-file "file" "r"))))) }