#!/usr/local/chickens/spiffy/bin/csi -s (use lowdown files data-structures) ;; Avoid unnecessarily loading Spiffy again ;; (this must be as fast as possible) (define (htmlize str) (string-translate* str '(("<" . "<") (">" . ">") ("\"" . """) ("'" . "'") ("&" . "&")))) (define (text->html) (write-string (string-append "
\n" (htmlize (read-string)) "\n
\n"))) (define file (car (command-line-arguments))) (if (equal? (pathname-extension file) "md") (markdown->html (current-input-port)) (text->html))