-
- (defpackage "WHO-EXAMPLE" (:use "CL" "CL-WHO"))
- (in-package "WHO-EXAMPLE")
- (defvar *who-stream*)
-
- (defun some-snippet (content &optional (stream *who-stream*))
- (with-html-output (stream)
- (:div :class "snippet" (esc content))))
-
- (defun stuff ()
- (with-html-output-to-string (*who-stream*)
- (:body
- (loop for i from 1 to 10
- do (some-snippet (format nil "A snippet ~D" i))))))
-
- ;; (stuff) =>
- ;; "<body><div class='snippet'>A snippet 1</div><div class='snippet'>A snippet 2</div><div class='snippet'>A snippet 3</div><div class='snippet'>A snippet 4</div><div class='snippet'>A snippet 5</div><div class='snippet'>A snippet 6</div><div class='snippet'>A snippet 7</div><div class='snippet'>A snippet 8</div><div class='snippet'>A snippet 9</div><div class='snippet'>A snippet 10</div></body>"
-