svnwiki preview added by DerGuteMoritz on Sat Aug 4 23:21:55 2012
#!/bin/sh #| -*- mode: scheme -*- exec csi -s $0 "$@" |# (use srfi-1 svnwiki-sxml sxml-transforms multidoc spiffy) (define svnwiki-file (car (command-line-arguments))) (define (svnwiki-file->html) (with-output-to-string (lambda () (let* ((contents (call-with-input-file svnwiki-file svnwiki->sxml)) (contents (fold (lambda (rule contents) (pre-post-order* contents rule)) contents (html-transformation-rules contents)))) (SRV:send-reply (pre-post-order* `((xhtml-1.0-strict) (html (head (meta (@ (http-equiv "content-type") (content "application/xhtml+xml; charset=UTF-8"))) (link (@ (href "http://wiki.call-cc.org/chicken.css") (rel "stylesheet") (type "text/css")))) (body (div (@ (id "content")) (inject ,contents))))) (cons `(inject *preorder* . ,(lambda (_ x) x)) universal-conversion-rules*))))))) (vhost-map `(((* any) . ,(lambda (continue) (send-response body: (svnwiki-file->html)))))) (print "http://localhost:8090/") (start-server port: 8090)