Skip to content

Instantly share code, notes, and snippets.

@making
Created December 4, 2009 01:57
Show Gist options
  • Save making/248773 to your computer and use it in GitHub Desktop.
Save making/248773 to your computer and use it in GitHub Desktop.
(defmacro sexp-file->html (fname)
(let ((sexp (with-open-file (f fname) (read f))))
`(cl-who:with-html-output-to-string (*standard-output*) ,sexp)
)
)
;; -- foo.sexp --
;; (:p
;; (:ul
;; (:li "foo")
;; (:li "bar")
;; )
;; )
;; ----
;; CL-USER> (sexp-file->html "foo.sexp")
;; -> "<p><ul><li>foo</li><li>bar</li></ul></p>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment