-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmake.lisp
executable file
·38 lines (32 loc) · 1.57 KB
/
make.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#|
exec sbcl \
--noinform \
--disable-debugger \
--eval "(ql:quickload '(clip cl-markless-plump) :silent T)" \
--load "$0" \
--eval "(cl-user::run)" \
--quit \
--end-toplevel-options "${@:1}"
|#
(defvar *here* (make-pathname :name NIL :type NIL
:defaults #.(or *load-pathname*
(error "Please simply LOAD this file."))))
(defun file (name type)
(make-pathname :name name :type type :defaults *here*))
(defclass example (org.shirakumo.markless.plump:plump) ())
(defmethod cl-markless:output-component ((component cl-markless-components:code-block) (target plump-dom:nesting-node) (format example))
(if (and (string= "markless" (cl-markless-components:language component))
(find "example" (cl-markless-components:options component) :test #'string=))
(let ((container (plump-dom:make-element target "div")))
(setf (plump-dom:attribute container "class") "example")
(cl-markless:output-component component container 'org.shirakumo.markless.plump:plump)
(cl-markless:output (cl-markless-components:text component) :target container :format format))
(call-next-method)))
(clip:define-tag-processor "main" (node)
(cl-markless:output (file "README" "mess")
:target node :format 'example))
(defun run (&key (input (file "template" "ctml"))
(output (file "index" "html")))
(with-open-file (output output :direction :output
:if-exists :supersede)
(plump:serialize (clip:process input) output)))