diff --git a/docs/plugin-use.md b/docs/plugin-use.md index fba2d6e..dd4f4c7 100644 --- a/docs/plugin-use.md +++ b/docs/plugin-use.md @@ -14,6 +14,13 @@ **Example**: `(analytics :tracking-code "google-provided-unique-id")` +## CL-WHO + +**Description**: Allows the user to write posts cl-who markup. Just create a +post with `format: cl-who` and the plugin will do the rest. + +**Example**: (cl-who) + ## Comments via Disqus **Description**: Provides comment support through diff --git a/plugins/cl-who.lisp b/plugins/cl-who.lisp new file mode 100644 index 0000000..2d66a5a --- /dev/null +++ b/plugins/cl-who.lisp @@ -0,0 +1,23 @@ +(eval-when (:compile-toplevel :load-toplevel) + (ql:quickload 'cl-who)) + +(defpackage :coleslaw-cl-who + (:use #:cl #:cl-who) + (:import-from #:coleslaw :render-text) + (:export #:enable)) + +(in-package :coleslaw-cl-who) + +(defmethod render-text (text (format (eql :cl-who))) + (let* ((*package* (find-package "COLESLAW-CL-WHO")) + (sexps (with-input-from-string (v text) + (do* ((line (read v) + (read v nil 'done)) + (acc (list line) + (cons line acc))) + ((eql line 'done) + (nreverse (cdr acc))))))) + (eval `(with-html-output-to-string (v) ,@sexps)))) + +(defun enable () + )